コード例 #1
0
    IEnumerator ChangeLight_End(ActiveLight nextLight, float time)
    {
        yield return(new WaitForSeconds(time));

        light_on = nextLight;

        if (light_on == ActiveLight.None)
        {
            NoneShadow();
        }

        /*               Yui[0].SetActive(false);
         *             Yui[1].SetActive(false);
         *         if (light_on == ActiveLight.Front)
         *         {
         *             Yui[0].SetActive(true);
         *             Yui[1].SetActive(false);
         *         }
         *         else if (light_on == ActiveLight.Back)
         *         {
         *             Yui[0].SetActive(false);
         *             Yui[1].SetActive(true);
         *         }
         */
    }
コード例 #2
0
    // Start is called before the first frame update
    void Start()
    {
        GetCenterObj();
        light_on     = ActiveLight.Front;
        lightFlag[0] = true;
        lightFlag[1] = false;

        changeLight  = false;
        LocalPosY[0] = light_s[0].transform.localPosition.y;
        LocalPosY[1] = light_s[1].transform.localPosition.y;

        //---------------------------------------
        pointlightOn = false;
        //---------------------------------------
    }
コード例 #3
0
    public void ChageLight(ActiveLight playernum)
    {
        if (changeLight)
        {
            return;
        }
        changeLight = true;

        /*if (light_on == playernum)
         * {
         *  light_s[(int)playernum].ChangeLight(LocalPosY[1], gameObject);
         *  StartCoroutine(ChangeLight_End(ActiveLight.None, 1.2f));
         * }
         * else if (light_on == ActiveLight.None)
         * {
         *  light_s[(int)playernum].ChangeLight(LocalPosY[0], gameObject);
         *  StartCoroutine(ChangeLight_End(playernum, 0.2f));
         * }
         * else*/
        {
            for (int i = 0; i < light_s.Length; i++)
            {
                if (i == (int)light_on)
                {
                    light_s[i].ChangeLight(LocalPosY[1], gameObject);

                    StartCoroutine(ChangeLight_End((ActiveLight)((int)(light_on + 1) % 2),
                                                   0.9f));
                }
                else
                {
                    light_s[i].ChangeLight(LocalPosY[0], gameObject);
                }
            }
        }
    }