Beispiel #1
0
    /// <summary>
    /// Activates all door objects from door button. Maybe generalize later for other objects?
    /// </summary>
    private void ActivateAllButtonObjects()
    {
        // Loop through every door and activate
        for (int i = 0; i < listOfDoors.Count; i++)
        {
            Door door = listOfDoors[i].GetComponent <Door>();
            door.ActivateDoor();
        }
        // Change button state every call to this method
        isActive = !isActive;

        // Instantiating button press particles
        ParticleSystem particle = GameObject.Instantiate(pressParticle, transform);

        particle.transform.position = transform.position + new Vector3(0, 0, 100);
    }