コード例 #1
0
    //changes which of the canvases is visable
    private void ChangeVisableCanvas()
    {
        //if Reading is the active canvas
        if (listno == 0)
        {
            Q1.GetComponent <Canvas>().enabled = true;
            Q2.GetComponent <Canvas>().enabled = false;
            Q3.GetComponent <Canvas>().enabled = false;
        }

        //if Q1 is the active canvas
        if (listno == 1)
        {
            Q1.GetComponent <Canvas>().enabled = false;
            Q2.GetComponent <Canvas>().enabled = true;
            Q3.GetComponent <Canvas>().enabled = false;
        }

        //if Q2 is the active canvas
        if (listno == 2)
        {
            Q1.GetComponent <Canvas>().enabled = false;
            Q2.GetComponent <Canvas>().enabled = false;
            Q3.GetComponent <Canvas>().enabled = true;
        }
    }
コード例 #2
0
    IEnumerator Q2_Animation()
    {
        int temp = 0;

        while (temp < Q2_Ani.Length)
        {
            yield return(new WaitForSeconds(0.05f));

            Q2.GetComponent <Image>().sprite = Q2_Ani[temp++];
        }
    }
コード例 #3
0
    // Update is called once per frame
    void Update()
    {
        if (Quest.Q <= 2)
        {
            Q1.GetComponent <Image>().sprite = Sel;
        }

        else if (Quest.Q <= 5)
        {
            Q1.GetComponent <Image>().sprite = NotSel;
            Q2.GetComponent <Image>().sprite = Sel;
        }

        else
        {
            Q2.GetComponent <Image>().sprite = NotSel;
            Q3.GetComponent <Image>().sprite = Sel;
        }
    }
コード例 #4
0
    // Update is called once per frame
    void Update()
    {
        if (Quest.Q <= 2)
        {
            Q1.GetComponent <Image>().sprite = Sel_Q1;
        }

        else if (Quest.Q > 2 && Quest.Q <= 5)
        {
            Q2.GetComponent <Image>().sprite = Sel_Q2;
        }

        else if (Quest.Q > 5 && Quest.Q <= 7)
        {
            Q3.GetComponent <Image>().sprite = Sel_Q3;
        }

        if (QuestObj.active)
        {
            if (clear_Q1)
            {
                StartCoroutine(Q1_Animation());
                clear_Q1 = false;
            }

            if (clear_Q2)
            {
                StartCoroutine(Q2_Animation());
                clear_Q2 = false;
            }

            if (clear_Q3)
            {
                StartCoroutine(Q3_Animation());
                clear_Q3 = false;
            }
        }
    }