コード例 #1
0
    // Use this for initialization
    void Start()
    {
        gameManager = GameObject.Find("EventManager");                                       //Find the gameobject used to manage events

        sectors = GameObject.FindGameObjectsWithTag("Sector");                               //Find all gameobjects of sectors

        inputFieldObject = GameObject.Find("UnitsTextbox");                                  //Find the gameobject of the input field
        inputFieldText   = inputFieldObject.GetComponentInChildren <UnityEngine.UI.Text> (); //Find the text compontnt of the input field
        goButton         = GameObject.Find("GoButton");                                      //Find the gameobject of the submit button
        backButton       = GameObject.Find("BackButton");                                    //Find the gameobject of the submit button

        mode = 1;                                                                            //Set the mode to 1...where the attacking sector is picked (where units are moved from)

        inputFieldObject.SetActive(false);                                                   //Disable (and hide) the input field
        goButton.SetActive(false);                                                           //submit button
        backButton.SetActive(false);                                                         //and undo button

        gameInstructions.text = "Pick a sector to attack with...";                           //Set the game instructions to tell user next action they should take

        chanceCards = GameObject.Find("CardUI").GetComponent <ChanceCards>();
        assignUnits = this.gameObject.GetComponentInChildren <AssignUnits>();

        settingsButton   = GameObject.Find("SettingsButton").GetComponent <Button>();
        helpButton       = GameObject.Find("HelpButton").GetComponent <Button>();
        chanceCardButton = GameObject.Find("CardButton").GetComponent <Button>();

        minigame = GameObject.Find("Minigame");
        minigame.SetActive(false);
        minigameStatus = this.gameObject.GetComponent <MinigameStatus>();
    }
コード例 #2
0
ファイル: Game.cs プロジェクト: rtwm500/SEPR-ASS4
    // Use this for initialization
    void Start()
    {
        neutralAI          = GetComponent <NeutralAI>();
        assignUnits        = GetComponent <AssignUnits> ();
        suddenDeath        = GetComponent <SuddenDeath>();
        conflictResolution = GetComponent <ConflictResolution>();
        timerText          = GameObject.Find("TurnTimerText").GetComponent <Text>();
        sections           = GameObject.Find("Sectors").GetComponentsInChildren <Section>();

        if (Data.IsDemo)
        {
            StartCoroutine("DemoModeRoutine");
        }
        if (Data.GameFromLoaded)
        {
            // Restores the current turn value
            SetTurn(SaveGameHandler.loadedGame.CurrentTurn);
        }
    }