コード例 #1
0
 private void Update()
 {
     if (gsession != null)
     {
         countdownText.text = gsession.countdown.timeRemaining.ToString();
     }
     else
     {
         gsession = FindObjectOfType <GameSessionSingleton>();
     }
 }
コード例 #2
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);
    }
コード例 #3
0
 // Start is called before the first frame update
 void Start()
 {
     //gameSingleton = FindObjectOfType<GameStatusSingleton>();
     gameSingleton = GameObject.Find("Game Session Singleton").GetComponent <GameSessionSingleton>();
 }