📅  最后修改于: 2022-03-11 14:48:56.029000             🧑  作者: Mango
public class Upgrader1 : MonoBehaviour
{
PlayerController PlayerController; //It should be member variable
void Start()
{
GameObject Player = GameObject.Find("Player");
PlayerController = Player.GetComponent();
}
public void Upgrade1()
{
PlayerController.speed++;
}
}