Пример #1
0
    void TaskOnClick()
    {
        int maxLength;

        switch (gameObject.name)
        {
        case "next":
            maxLength = GazeData.gazeList.gaze.Length;
            Debug.Log("You have clicked the button! MaxLength " + maxLength + " " + gameObject.name);
            currId++;
            if (currId == maxLength)
            {
                currId = 0;
            }
            myGaze.UpdateBoardcast();
            break;

        case "prev":
            maxLength = GazeData.gazeList.gaze.Length;
            Debug.Log("You have clicked the button! MaxLength " + maxLength + " " + gameObject.name);
            currId--;
            if (currId < 0)
            {
                currId = maxLength - 1;
            }
            myGaze.UpdateBoardcast();
            break;

        default:
            if (transform.parent.Find("aoiImage").GetComponent <Image>().fillAmount == 0)
            {
                transform.parent.Find("aoiImage").GetComponent <Image>().fillAmount = 1;
            }
            else
            {
                transform.parent.Find("aoiImage").GetComponent <Image>().fillAmount = 0;
            }
            break;
        }

        Debug.Log("Update Success!");
    }