Exemple #1
0
    void Awake()
    {
        doorsEnter = GameObject.FindObjectsOfType <EnterDoorManager>();

        if (SaveManager.Instance.comingFromCollectables)
        {
            if (SaveManager.Instance.LevelCollectableLoaded == NextLevel)
            {
                for (int i = 0; i < doorsEnter.Length; ++i)
                {
                    if (doorsEnter[i] != null)
                    {
                        if (!doorsEnter[i].ItsAnotherDoor)
                        {
                            EnterDoorManager door = doorsEnter[i];
                            door.isStartLevel     = false;
                            door.canStartAnalitic = false;
                            door.SetLevelCounterTimer(SaveManager.Instance.currentTimePlayLevel);
                            break;
                        }
                    }
                }
            }
        }
    }
Exemple #2
0
    protected override void Init()
    {
        base.Init();

        CameraChase chase = Camera.main.gameObject.GetComponent <CameraChase>();

        if (chase == null)
        {
            chase = Camera.main.gameObject.AddComponent <CameraChase>();
        }

        if (chase != null)
        {
            chase.enabled = false;
        }

        Camera.main.GetComponent <CameraMovement>().enabled = false;
        Door = GameObject.FindObjectOfType <EnterDoorManager>();

        if (ChaseByDead)
        {
            Door.isStartLevel     = false;
            Door.canStartAnalitic = false;
            Door.SetLevelCounterTimer(currentTimePlayLevel);
        }
        else
        {
            currentTimePlayLevel = 0;
        }
    }