コード例 #1
0
    void  Start()
    {
        playButtons = this.transform.Find("PlayButtons");
        yesButton   = playButtons.GetComponentInChildren <YesButton>();
        yesButton.AddEventListener(this.gameObject);
        noButton = playButtons.GetComponentInChildren <NoButton>();
        noButton.AddEventListener(this.gameObject);

        playButtons.active = false;

        bombChain       = this.transform.Find("BombChain").gameObject;
        maxHand         = this.transform.Find("MaxHand").GetComponent <Hand>();
        bombAttachSound = this.transform.Find("BombAttachSound").GetComponent <SoundObject>();
        maxHand.AddEventListener(this.gameObject);
        chainHand = this.transform.Find("ChainHand").GetComponent <Hand>();
        chainHand.AddEventListener(this.gameObject);

        textBoxManagerAfterFirstDialogue = this.transform.Find("TextBoxManagerAfterFirstDialogue").GetComponent <TextBoxManager>();
        textBoxManagerAfterFirstDialogue.AddEventListener(this.gameObject);

        textBoxManagerAfterFirstDialogue.active = false;

        playerControl = this.GetComponentInChildren <MenuPlayerControl>();
        maxHand.AddEventListener(playerControl.gameObject);

        AttachChainToMax();
    }
コード例 #2
0
    // Use this for initialization
    void  Awake()
    {
        int timeRanOut = PlayerPrefs.GetInt(GlobalSaveVars.TIMERANOUTNAME, 0);

        if (timeRanOut == 1 && !disableTimeout)
        {
            MaxLoader.LoadAlternativeEndScene();
        }

        maxHand = this.transform.Find("MaxHand").GetComponent <Hand>();
        maxHand.AddEventListener(this.gameObject);
        textBoxManagerFirst = this.transform.Find("TextBoxManagerFirst").GetComponent <TextBoxManager>();

        textBoxManagerFirst.AddEventListener(this.gameObject);

        playerControl = this.GetComponentInChildren <MenuPlayerControl>();
        maxHand.AddEventListener(playerControl.gameObject);
    }
コード例 #3
0
ファイル: GameManager.cs プロジェクト: duckbridge/15-min-max
    // 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();
    }