void Start()
    {
        m_aiPowerScript     = gameObject.GetComponent <AIPower>();
        m_lockedDoorPower   = m_aiPowerScript.doorLockedPower;
        m_unlockedDoorPower = m_aiPowerScript.doorUnlockedPower;
        m_doorsLength       = m_specificDoorScripts.Length;
        m_locked            = new bool[m_doorsLength];
        m_powered           = new bool[m_doorsLength];
        m_lockedOutAction   = new bool[m_doorsLength];

        m_doorStates = new int[m_doorsLength];

        for (int i = 0; i < m_doorsLength; i++)
        {
            if (i != 4)
            {
                m_locked[i]          = true;
                m_powered[i]         = true;
                m_lockedOutAction[i] = false;
                m_doorStates[i]      = 1;
            }
        }
        //LockAllDoors();
        m_specificDoorScripts[4].TutorialDoor(true);
        //Invoke("FirstDoor", 1f);
    }
Пример #2
0
    void Start()
    {
        m_documentControllerScript = GetComponentInParent <DocumentController>();
        m_aiPower    = GameObject.FindGameObjectWithTag("AI").GetComponent <AIPower>();
        m_buttonText = GetComponentInChildren <Text>();

        UpdateButtonText(isUnlocked ? 2 : 0, 0.0f);
    }
Пример #3
0
 // Use this for initialization
 void Start()
 {
     m_passwordGeneratorScript = gameController.GetComponent <PasswordGenerator>();
     m_aiPower = ai.GetComponent <AIPower>();
     m_doorControllerScript = ai.GetComponent <DoorController>();
     Invoke("GetPassword", 1f);
     CheckLocks();
 }
 void Start()
 {
     m_aiObjectiveScript = GetComponent <AIObjectives>();
     m_aiPowerScript     = gameObject.GetComponent <AIPower>();
     m_lightPower        = m_aiPowerScript.lightPower;
     m_lightOn           = new bool[lights.Length];
     for (int i = 0; i < lights.Length; i++)
     {
         m_lightOn[i] = true;
     }
     CheckLights();
 }
Пример #5
0
 // Use this for initialization
 void Start()
 {
     m_scientistButtonNo          = Random.Range(0, 8);
     m_aiButtonNo                 = Random.Range(0, 8);
     m_blackoutScript             = blackoutCanvas.GetComponent <Blackout>();
     m_doorControllerScript       = ai.GetComponent <DoorController>();
     m_aiPowerScript              = ai.GetComponent <AIPower>();
     m_robotBodyScript            = robotBody.GetComponent <RobotBody>();
     m_timerScript                = gameController.GetComponent <Timer>();
     m_hackingDocumentScript      = ai.GetComponent <HackingDocuments>();
     m_aiButtonPressedText        = aiButtonPressedGO.GetComponent <Text>();
     m_scientistButtonPressedText = scientistButtonPressedGO.GetComponentInChildren <Text>();
     TextWriteUp();
 }
Пример #6
0
 void Start()
 {
     //Image[] images = GetComponentsInChildren<Image>();
     //m_fillImage = images[1];
     m_aiPower    = GameObject.FindGameObjectWithTag("AI").GetComponent <AIPower>();
     m_buttonText = GetComponentInChildren <Text>();
     if (isUnlocked)
     {
         m_buttonText.text = string.Format("{0} - {1} {2}%", docName, m_currentStatus[2], 0.0f);
     }
     else
     {
         m_buttonText.text = string.Format("{0} - {1} {2}%", docName, m_currentStatus[0], 0.0f);
     }
 }
Пример #7
0
    // Use this for initialization
    void Start()
    {
        m_blackoutScript        = blackoutCanvas.GetComponent <Blackout>();
        m_doorControllerScript  = ai.GetComponent <DoorController>();
        m_lightControllerScript = ai.GetComponent <LightController>();
        m_cameraController      = ai.GetComponent <CameraController>();
        m_aiPowerScript         = ai.GetComponent <AIPower>();
        m_robotBodyScript       = robotBody.GetComponent <RobotBody>();
        m_timerScript           = gameController.GetComponent <Timer>();
        m_hackingDocumentScript = ai.GetComponent <HackingDocuments>();
        m_buttonAudioSource     = switchesButton.GetComponent <AudioSource>();
        m_buttonAnimator        = switchesButton.GetComponent <Animator>();
        m_randObjects           = Random.Range(0, 3);
        m_randPower             = Random.Range(0, 3);

        for (int i = 0; i < m_actionNumber.Length; i++)
        {
            m_numberList.Add(i);
        }

        for (int i = 0; i < m_actionNumber.Length; i++)
        {
            int randomNo = Random.Range(0, m_numberList.Count);
            m_actionNumber[i] = m_numberList[randomNo];

            m_numberList.Remove(m_numberList[randomNo]);
            if (m_actionNumber[i] != 7)
            {
                m_actionMessages[i] = string.Format("Switches on {0} will {1}", m_switchPositions[i], m_actions[m_actionNumber[i]]);
            }
            else
            {
                m_actionMessages[i] = string.Format("Switches on {0} will increase {1} by {2} power", m_switchPositions[i], m_poweredObjects[m_randObjects], m_powerIncreased[m_randPower]);
            }
            if (i == 0)
            {
                m_currentNumber = m_actionNumber[i];
                //print(m_currentNumber);
            }
            if (m_actionNumber[i] == 3)
            {
                robotBodySwitches.text = string.Format("Switches are required to be at: {0}", m_switchPositions[i]);
            }
        }
        ScientistSwitchInfo();
        AISwitchInfo();
    }
Пример #8
0
    // Use this for initialization
    void Start()
    {
        m_aiPowerScript     = gameObject.GetComponent <AIPower>();
        m_aiObjectiveScript = GetComponent <AIObjectives>();
        m_cameraPower       = m_aiPowerScript.cameraPower;
        m_cameraLightLength = cameras.Length;
        m_camerasOn         = new bool[m_cameraLightLength];

        m_cameraLightRenderers = new Renderer[m_cameraLightLength];
        for (int i = 0; i < m_cameraLightLength; i++)
        {
            m_cameraLightRenderers[i] = cameraLights[i].GetComponent <Renderer>();
        }
        for (int i = 0; i < m_cameraLightLength; i++)
        {
            m_camerasOn[i] = true;
        }
        CheckCameras();
    }
    // Use this for initialization
    void Start()
    {
        m_ai                     = GameObject.FindGameObjectWithTag("AI");
        m_aiPowerScript          = m_ai.GetComponent <AIPower>();
        m_doorLockPower          = m_aiPowerScript.doorLockedPower;
        m_doorControllerScript   = m_ai.GetComponent <DoorController>();
        m_doorsLength            = m_doorControllerScript.m_specificDoorScripts.Length;
        m_doorLockedToggleArray  = new Toggle[m_doorsLength];
        m_doorPoweredToggleArray = new Toggle[m_doorsLength];
        m_countingDown           = new float[m_doorsLength];
        m_isCounting             = new bool[m_doorsLength];
        m_lockedOutAction        = new bool[m_doorsLength];
        m_shutOutTime            = shutOutTime;

        for (int i = 0; i < m_doorsLength; i++)
        {
            GameObject doorToggleClone = Instantiate(doorToggles, new Vector3(0, 0, 0), Quaternion.identity) as GameObject;
            //new Text[3] cloneText = doorToggleClone.GetComponentsInChildren<Text>();
            Text[] cloneText = new Text[3];
            cloneText = doorToggleClone.GetComponentsInChildren <Text>();
            for (int j = 0; j < 3; j++)
            {
                cloneText[j].font = textFont;
            }
            //.font = textFont;
            doorToggleClone.transform.SetParent(gameObject.transform);

            DoorToggle doorToggleScript = doorToggleClone.GetComponent <DoorToggle>();

            m_doorToggleArray           = doorToggleClone.GetComponentsInChildren <Toggle>();
            m_doorLockedToggleArray[i]  = m_doorToggleArray[0];
            m_doorPoweredToggleArray[i] = m_doorToggleArray[1];

            doorToggleScript.doorID = i;
            doorToggleScript.ChangeName();

            m_countingDown[i] = m_shutOutTime;

            m_lockedOutAction[i] = false;
        }
    }