public void Locking(int doorNo)
 {
     //print("locking: door controller");
     if (m_locked[doorNo])
     {
         if (m_lockedOutAction[doorNo])
         {
             m_specificDoorScripts[doorNo].DoorPower("Unlock");
             m_locked[doorNo]          = false;
             m_lockedOutAction[doorNo] = false;
         }
         else
         {
             m_aiPowerScript.PowerExchange(m_lockedDoorPower);
             m_specificDoorScripts[doorNo].DoorPower("Unlock");
             m_locked[doorNo] = !m_locked[doorNo];
         }
     }
     else
     {
         if (m_aiPowerScript.CheckPower(m_lockedDoorPower) == true)
         {
             m_aiPowerScript.PowerExchange(-m_lockedDoorPower);
             m_specificDoorScripts[doorNo].DoorPower("Lock");
             m_locked[doorNo] = !m_locked[doorNo];
         }
         else
         {
             //no power
         }
     }
 }
 public void EnoughPowerLocked()
 {
     for (int i = 0; i < m_doorsLength; i++)
     {
         if (m_doorLockedToggleArray[i].isOn == false && m_isCounting[i] == false)
         {
             if (!m_lockedOutAction[i] && m_aiPowerScript.CheckPower(m_doorLockPower))
             {
                 m_doorLockedToggleArray[i].interactable = true;
             }
         }
     }
 }
Exemplo n.º 3
0
 public void CameraSwitch(int camNo)
 {
     //print("Message Recieved " + camNo);
     if (m_camerasOn[camNo] == true)
     {
         cameras[camNo].enabled = false;
         m_cameraLightRenderers[camNo].material = materials[0];
         m_camerasOn[camNo] = !m_camerasOn[camNo];
         m_aiPowerScript.PowerExchange(m_cameraPower);
         taskLogScript.UpdateText("Camera", camNo, 1);
         //cameraText[camNo].text = "Offline";
         //cameraRecImage[camNo].SetActive(false);
     }
     else
     {
         if (m_aiPowerScript.CheckPower(m_cameraPower) == true)
         {
             m_cameraLightRenderers[camNo].material = materials[1];
             cameras[camNo].enabled = true;
             m_camerasOn[camNo]     = !m_camerasOn[camNo];
             m_aiPowerScript.PowerExchange(-m_cameraPower);
             taskLogScript.UpdateText("Camera", camNo, 0);
             //cameraText[camNo].text = "Recording";
             //cameraRecImage[camNo].SetActive(true);
         }
     }
     CheckCameras();
 }
    public void LightSwitch(int lightNo)
    {
        if (m_lightOn[lightNo] == true)
        {
            lights[lightNo].enabled = false;
            m_lightOn[lightNo]      = !m_lightOn[lightNo];
            m_aiPowerScript.PowerExchange(m_lightPower);
            taskLogScript.UpdateText("Light", lightNo, 1);
        }
        else
        {
            if (m_aiPowerScript.CheckPower(m_lightPower) == true)
            {
                lights[lightNo].enabled = true;
                m_lightOn[lightNo]      = !m_lightOn[lightNo];
                m_aiPowerScript.PowerExchange(-m_lightPower);
                taskLogScript.UpdateText("Light", lightNo, 0);
            }
        }
        CheckLights();

        if (lightNo == m_lightOne && !m_lightOneOn)
        {
            m_isCountingDown = true;
            m_lightOneOn     = true;
        }

        if (lightNo == m_lightTwo && m_lightOneOn && m_isCountingDown)
        {
            agentObjectiveScript.LightSwitchSequenceObjective(0, true);
        }
    }