Пример #1
0
    private void OnTriggerExit(Collider other)
    {
        if (other.gameObject.tag == "LightRangeCollider")
        {
            // add both torch scripts to lists for later use
            TorchColor  thisTorchColor  = other.transform.parent.GetComponent <TorchColor>();
            TorchSwitch thisTorchSwitch = other.transform.parent.GetComponent <TorchSwitch>();

            torchesColor.Remove(thisTorchColor);
            torchesSwitch.Remove(thisTorchSwitch);
        }
    }
Пример #2
0
    private void UpdateLevelStartVariables()
    {
        GrabPlayerSpawnPositions();

        torchesGO  = GameObject.FindWithTag("Torches");
        doorsGO    = GameObject.FindWithTag("Doors");
        messagesGO = GameObject.FindWithTag("Messages");

        torchesColor = new TorchColor[torchesGO.transform.childCount];
        torches      = new TorchSwitch[torchesGO.transform.childCount];

        for (int i = 0; i < torchesGO.transform.childCount; i++)
        {
            torchesColor[i] = torchesGO.transform.GetChild(i).GetComponent <TorchColor>();
            torches[i]      = torchesGO.transform.GetChild(i).GetComponent <TorchSwitch>();
        }

        torchSwitch16 = torches[2];
        torchSwitch17 = torches[3];

        torchColor16 = torchesColor[2];
        torchColor17 = torchesColor[3];

        doors = new DoorSwitch[doorsGO.transform.childCount];

        for (int i = 0; i < doorsGO.transform.childCount; i++)
        {
            doors[i] = doorsGO.transform.GetChild(i).GetComponent <DoorSwitch>();
        }

        door04 = doors[1];
        door06 = doors[3];

        messages = new RevealMessage[messagesGO.transform.childCount];

        for (int i = 0; i < messagesGO.transform.childCount; i++)
        {
            messages[i] = messagesGO.transform.GetChild(i).GetComponent <RevealMessage>();
        }

        message04a = messages[4];
        message04b = messages[5];
        message05a = messages[6];
        message05b = messages[7];
        message06a = messages[8];
        message06b = messages[9];
    }
Пример #3
0
    private void OnTriggerEnter(Collider other)
    {
        // collided with torch range collider
        if (other.gameObject.tag == "LightRangeCollider")
        {
            // add both torch scripts to lists for later use
            TorchColor  thisTorchColor  = other.transform.parent.GetComponent <TorchColor>();
            TorchSwitch thisTorchSwitch = other.transform.parent.GetComponent <TorchSwitch>();

            torchesColor.Add(thisTorchColor);
            torchesSwitch.Add(thisTorchSwitch);
        }

        // collided with torch range collider
        if (other.gameObject.tag == "LightRangeColliderBlock")
        {
            // add both torch scripts to lists for later use
            BlockLightColor thisBlockColor = other.transform.parent.GetComponent <BlockLightColor>();

            blocksColor.Add(thisBlockColor);
        }
    }
Пример #4
0
 // Use this for initialization
 void Start()
 {
     torchColorScript  = transform.parent.GetComponent <TorchColor>();
     torchSwitchScript = transform.parent.GetComponent <TorchSwitch>();
 }
Пример #5
0
 public void MakeBigAndChangeColor(Collider2D col) {
     if (sizeFactor < maxScaleFactor) {
         sizeFactor++;
         makeMeBig.startLifetime = 1f;
         makeMeBig.Emit(300);
         changeTorchType = true;
         FIREUIScript.ChangeColor(currentTorchType = col.gameObject.GetComponent<EreDayBeTorching>().colorMeHappy);
         hitCoolDown = Time.time;
         SizeFix();
     }
 }