Esempio n. 1
0
    // Use this for initialization

    public virtual void Start()
    {
        hills = new List <ITweenMovableObject>(
            this.transform.Find("mainCamera/Hills").GetComponentsInChildren <ITweenMovableObject>()
            );

        pauseMenu = this.GetComponentInChildren <PauseMenu>();
        pauseMenu.AddEventListener(this.gameObject);
        pauseMenu.active = false;

        gameTimer = this.GetComponentInChildren <GameTimer>();
        gameTimer.OnPauseGame();

        docam         = this.GetComponentInChildren <DoCam>();
        docam.enabled = false;

        hand = this.GetComponentInChildren <Hand>();
        hand.AddEventListener(this.gameObject);

        player = this.GetComponentInChildren <PlayerControl>();

        player.AddEventListener(this.gameObject);
        gameTimer.AddEventListener(this.gameObject);
        hand.AddEventListener(player.gameObject);

        float savedTime = PlayerPrefs.GetFloat(GlobalSaveVars.TIMELEFT, -1);

        bombTimer = this.GetComponentInChildren <BombTimer>();

        if (savedTime != -1 && useSavedTime)
        {
            gameTimer.SetStartTimeInMS(savedTime);
        }

        DropPlayer();
    }