質問

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