Exemple #1
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        if (instance != this)
        {
            Destroy(this);
        }

        DontDestroyOnLoad(this);

        if (_GameManager.instance != null)
        {
            if (!tutorialScene)
            {
                matchByTime = _GameManager.instance.gameByTime;
            }
        }

        if (levelMusic != "")
        {
            musicEvent = FMODUnity.RuntimeManager.CreateInstance(levelMusic);
        }
    }
 private void Start()
 {
     actualAmmo = initialAmmo;
     stateMachine.ChangeState(idleState);
     spawnPosition = transform.position;
     levelManager  = _LevelManager.instance;
     resetKiller   = ResetKiller();
 }
    private void Awake()
    {
        if (_instance != null && _instance != this)
        {
            Destroy(this.gameObject);
        }
        else
        {
            _instance = this;
        }
        levelPanelTrans = transform.Find("LevelPanel");
        if (levelPanelTrans == null)
        {
            Debug.LogError("Can't Find Level Panel");
            return;
        }

        numLevels = levelPanelTrans.childCount;
    }