Esempio n. 1
0
 public void ChangeFlame(Material inMat)
 {
     if (thisTorch.GetTorchState() == false)
     {
         ChangeMaterial(inMat);
         ChangeLightColor(inMat);
     }
     else
     {
         if (canChangeColour == true)
         {
             ChangeMaterial(inMat);
             ChangeLightColor(inMat);
         }
         else
         {
             if (justTurnedOn == false)
             {
                 ChangeMaterial(inMat);
                 ChangeLightColor(inMat);
                 justTurnedOn = true;
             }
         }
     }
 }
Esempio n. 2
0
    private void OnTriggerEnter(Collider collider)
    {
        if (collider.gameObject.CompareTag("LightBullet"))
        {
            if (torchSwitchScript.GetTorchState() == false)
            {
                torchSwitchScript.On();
                torchColorScript.ChangeColorState(collider.gameObject.name);
            }

            else
            {
                torchColorScript.ChangeColorState(collider.gameObject.name);
            }
        }
    }
Esempio n. 3
0
    // Update is called once per frame
    void Update()
    {
        if (goal.GetGoalReached())
        {
            goalReached    = true;
            countDown.text = "";
        }
        else
        {
            goalReached = false;
        }

        if (torchSwitch.GetTorchState())
        {
            startTimer = true;
        }


        if (startTimer == true && goalReached == false)
        {
            timer      -= Time.deltaTime;
            audioTimer -= Time.deltaTime;

            countDown.text = ((int)(timer + 1f)).ToString();

            if (audioTimer <= 0f)
            {
                audioTick.Play();
                float audioSpeedRatio = timer / onTime;
                if (audioSpeedRatio <= 0.15f)
                {
                    audioSpeedRatio = 0.15f;
                }
                audioTimer = audioTimeBetweenTicks * audioSpeedRatio;
            }

            if (timer <= 0f)
            {
                startTimer = false;
                torchSwitch.Off();
                audioTimer     = audioTimeBetweenTicks;
                timer          = onTime;
                countDown.text = "";
            }
        }
    }
Esempio n. 4
0
    private void UnlockDoor07()
    {
        if (torch == null)
        {
            UpdateLevelStartVariables();
        }

        if (torch.GetTorchState() || reachedDoor == true)
        {
            door07Unlocked = true;
        }
        else
        {
            door07Unlocked = false;
        }

        DoorLogic(door, door07Unlocked);
    }
Esempio n. 5
0
    private void UnlockDoor04()
    {
        if (torchSwitch16.GetTorchState() && torchSwitch17.GetTorchState())
        {
            if (torchColor16.GetColorState() == "Red")
            {
                if (torchColor17.GetColorState() == "Yellow")
                {
                    door04Unlocked = true;
                }
                else
                {
                    door04Unlocked = false;
                }
            }
            else if (torchColor16.GetColorState() == "Yellow")
            {
                if (torchColor17.GetColorState() == "Red")
                {
                    door04Unlocked = true;
                }
                else
                {
                    door04Unlocked = false;
                }
            }
            else
            {
                door04Unlocked = false;
            }
        }
        else
        {
            door04Unlocked = false;
        }

        if (debugUnlockAllDoors == true)
        {
            door04Unlocked = true;
        }
        DoorLogic(door04, door04Unlocked);
    }