Esempio n. 1
0
    //called from the controller events on the RightControllerScriptAlias
    public void CycleThroughPointers()
    {
        if (currentPointer != null)
        {
            currentPointer.SetActive(false);
        }

        if (arrayPos >= pointers.Length - 1)
        {
            arrayPos = -1;
        }
        else
        {
            arrayPos += 1;
        }

        if (arrayPos == -1)
        {
            foreach (GameObject pointer in pointers)
            {
                pointer.SetActive(false);
            }
        }
        else
        {
            currentPointer = pointers[arrayPos];
            currentPointer.SetActive(true);
        }

        if (currentPointer.GetComponent <ObjectEditor>() == null)
        {
            objEditor.DeselectObject();
        }
    }