문제

i am trying to do something that should be quite simple, call a method from a another class, I have allready done it once in my project but this time it doesn't work.

How I am calling the method:

Characters.Character_One.MoveLeft();

this is the contents of the method I am trying to call:

public static void MoveLeft(Character_One c)
{
    c.s.Top -= movespeed;
}
도움이 되었습니까?

해결책

You're not passing it the parameter it requires - an instance of Character_One.

var charOne = new Character_One();

Characters.Character_One.MoveLeft(charOne);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top