Exemplo n.º 1
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);
        }
    }
Exemplo n.º 3
0
    public void PoweringUp()
    {
        if (!m_poweringUp)
        {
            m_currentPower = m_aiPower.CurrentPower();
            m_aiPower.PowerExchange(-m_currentPower);
            m_poweringUp = true;
        }

        /*
         * if (!m_poweringUp)
         * {
         *  float percentage = Mathf.FloorToInt(choosePowerSlider.value);
         *  m_currentPower = Mathf.FloorToInt((m_aiPower.totalPower * 0.01f) * percentage);
         *  print(m_aiPower.totalPower * 0.01f);
         *  print(m_currentPower);
         *  if (m_aiPower.CheckPower(m_currentPower) == true)
         *  {
         *      m_poweringUp = true;
         *      m_aiPower.PowerExchange(-m_currentPower);
         *  }
         *  else
         *  {
         *      print("Not enough Power");
         *  }
         *
         * }
         */
    }
    public void ChangeDoorState(int doorNo)
    {
        m_doorStates[doorNo] = (m_doorStates[doorNo] + 1) % 3;

        if (m_doorStates[doorNo] == 0)
        {
            m_specificDoorScripts[doorNo].DoorPower("Off");
        }
        else if (m_doorStates[doorNo] == 1)
        {
            m_specificDoorScripts[doorNo].DoorPower("On");
            m_specificDoorScripts[doorNo].DoorPower("Unlock");
        }
        else
        {
            m_specificDoorScripts[doorNo].DoorPower("Lock");
        }
        m_aiPowerScript.PowerExchange(m_statePower[m_doorStates[doorNo]]);
        taskLogScript.UpdateText("Door", doorNo, m_doorStates[doorNo] + 2);
    }
Exemplo n.º 5
0
 void PowerExchange()
 {
     m_aiPowerScript.PowerExchange(m_powerSent);
 }