Exemplo n.º 1
0
    void OnMouseDown()
    {
        if (!cs.getCharacterSelection())
        {
            for (int i = 0; i < cs.characterList.Length; i++)
            {
                if (cs.characterList [i].gameObject.name == this.gameObject.name)
                {
                    cs.setIndex(i);
                    canvas.gameObject.SetActive(true);
                    cs.setCharacterSelection(true);
                    Debug.Log(i);
                }
            }

            GameObject[] lights = GameObject.FindGameObjectsWithTag("SelectionLight");
            foreach (GameObject light in lights)
            {
                light.GetComponent <Light> ().enabled = false;
            }
            spotlight.GetComponent <Light> ().enabled = true;
        }
    }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     cs = FindObjectOfType <CharacterSelection> ();
     canvas.gameObject.SetActive(false);
     cs.setCharacterSelection(false);
 }