コード例 #1
0
    private void Update()
    {
        // Check if not loaded and has references
        if (isLoaded == LoadingStages.NotLoaded && m_CharacterSpawner != null && m_LevelSpawner != null)
        {
            SetupGame();
            timer    = GetComponent <S_Timer>();
            isLoaded = LoadingStages.Loading;
        }

        if (isLoaded == LoadingStages.Loading && CharacterSpawned && LevelSpawned)
        {
            isLoaded = LoadingStages.Loaded;
            timer.StartTimer();
        }

        if (isLoaded == LoadingStages.Loaded)
        {
            // do shit
        }

        //Debug Respawn
        //if (Input.GetKeyDown(KeyCode.K))
        //{
        //    Destroy(ref_Character);
        //    ref_Character = m_CharacterSpawner.SpawnCharacter();
        //}
    }
コード例 #2
0
 private void Awake()
 {
     instance = this;
 }