Beispiel #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);
        }

        // 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.Remove(thisBlockColor);
        }
    }
    //[SerializeField]
    //private LightCanonInteract lightCanonInteract;

    // Use this for initialization
    void Start()
    {
        blockLightColor = transform.parent.GetComponent <BlockLightColor>();
    }