예제 #1
0
    public void PickActive(int v)
    {
        if (v == -1 && currentActive != null)
        {
            nextActive = null; currentActive.fadeOut(); return;
        }
        if (v < 0 || v >= objects.Length)
        {
            Debug.Log("invalid selection " + v, gameObject); return;
        }
        //	for (int i=0;i<objects.Length;i++)
        //		if (objects[i]!=null)	objects[i].SetActive(i==v);
        if (objects[v] == currentActive)

        {
//Debug.Log("no action, already actibve");
//	return;
        }
        nextActive = objects[v];
        if (currentActive != null)
        {
            currentActive.fadeOut();
        }
        else
        {
            //	nextActive=objects[v];
        }
        objects[v].fadeIn();
    }