unity:静态实例类

public class GameManager : MonoBehaviour
{
    public static GameManager instance;

    private void Awake()
    {
        instance = this;
    }
    private int nPlayer = 4;
    private void Start()
    {
        nPlayer = 4;
    }

}

猜你喜欢

转载自blog.csdn.net/karonneveralone/article/details/124831357