Example #1
0
    void Update()
    {
        NetworkClientUI.SendJoystickInfo(variableJoystick.Vertical, variableJoystick.Horizontal, jump);

        timeCount += Time.deltaTime;
        if (timeCount > ThresholdTime)
        {
            timeCount = 0;
            jump      = false;
        }
    }
        void UpdateVirtualAxes(Vector3 value)
        {
            var delta = m_StartPos - value;

            delta.y = -delta.y;
            delta  /= MovementRange;
            if (m_UseX)
            {
                m_HorizontalVirtualAxis.Update(-delta.x);
            }

            if (m_UseY)
            {
                m_VerticalVirtualAxis.Update(delta.y);
            }
            NetworkClientUI.SendJoystickInfo(-delta.x, delta.y);
        }
Example #3
0
    // Update is called once per frame
    void Update()
    {
        //COUNTER DOUBLE CLICK
        if (!disable)
        {
            if (isCounting)
            {
                timer -= Time.deltaTime;
            }
            if (timer <= 0)
            {
                isCounting = false;
                timer      = 0.5f;
            }
        }
        else
        {
            distime -= Time.deltaTime;
        }

        if (distime <= 0)
        {
            distime = 0.75f;
            disable = false;
        }

        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //CONTROL UI
        if (isReverse)
        {
            for (int i = 0; i < UISLskill.Length - 1; i++)
            {
                UISLskill[i].SetActive(true);
            }
        }
        else
        {
            for (int i = 0; i < UISLskill.Length - 1; i++)
            {
                UISLskill[i].SetActive(false);
            }
        }

        if (player.name == "Knight")
        {
            //CHECK GUAGE
            for (int i = 0; i < 3; i++)
            {
                if (player.GetComponent <Healthpoint>().fp >= player.GetComponent <SkillInfo>().knightMFC[i] * 100)
                {
                    UIskill[i].sprite = knightNM[i];
                }
                else
                {
                    UIskill[i].sprite = knightGS[i];
                }
            }

            for (int j = 0; j < 3; j++)
            {
                if (player.GetComponent <Healthpoint>().mp >= player.GetComponent <SkillInfo>().knightMFC[j + 3] * 100 &&
                    player.GetComponent <SkillInfo>().knightCD[j, 0] >= player.GetComponent <SkillInfo>().knightCD[j, 1])
                {
                    UIskill[j + 3].sprite = knightNM[j + 3];
                }
                else
                {
                    UIskill[j + 3].sprite = knightGS[j + 3];
                }
            }

            if (player.GetComponent <SkillInfo>().knightCD[3, 0] >= player.GetComponent <SkillInfo>().knightCD[3, 1])
            {
                UIskill[6].sprite = knightNM[6];
            }
            else
            {
                UIskill[6].sprite = knightGS[6];
            }

            //CHECK COOLDOWN
            for (int k = 0; k < 4; k++)
            {
                if (player.GetComponent <SkillInfo>().knightCD[k, 0] < player.GetComponent <SkillInfo>().knightCD[k, 1])
                {
                    UICDskill[k].SetActive(true);
                }
                else
                {
                    UICDskill[k].SetActive(false);
                }

                CDTime[k].text = (player.GetComponent <SkillInfo>().knightCD[k, 1] - player.GetComponent <SkillInfo>().knightCD[k, 0]).ToString();
            }
        }

        else if (player.name == "Archer")
        {
            //CHECK GUAGE
            for (int i = 0; i < 3; i++)
            {
                if (player.GetComponent <Healthpoint>().fp >= player.GetComponent <SkillInfo>().archerMFC[i] * 100)
                {
                    UIskill[i].sprite = archerNM[i];
                }
                else
                {
                    UIskill[i].sprite = archerGS[i];
                }
            }

            for (int j = 0; j < 3; j++)
            {
                if (player.GetComponent <Healthpoint>().mp >= player.GetComponent <SkillInfo>().archerMFC[j + 3] * 100 &&
                    player.GetComponent <SkillInfo>().archerCD[j, 0] >= player.GetComponent <SkillInfo>().archerCD[j, 1])
                {
                    UIskill[j + 3].sprite = archerNM[j + 3];
                }
                else
                {
                    UIskill[j + 3].sprite = archerGS[j + 3];
                }
            }

            if (player.GetComponent <SkillInfo>().archerCD[3, 0] >= player.GetComponent <SkillInfo>().archerCD[3, 1])
            {
                UIskill[6].sprite = archerNM[6];
            }
            else
            {
                UIskill[6].sprite = archerGS[6];
            }

            //CHECK COOLDOWN
            for (int k = 0; k < 4; k++)
            {
                if (player.GetComponent <SkillInfo>().archerCD[k, 0] < player.GetComponent <SkillInfo>().archerCD[k, 1])
                {
                    UICDskill[k].SetActive(true);
                }
                else
                {
                    UICDskill[k].SetActive(false);
                }

                CDTime[k].text = (player.GetComponent <SkillInfo>().archerCD[k, 1] - player.GetComponent <SkillInfo>().archerCD[k, 0]).ToString();
            }
        }

        else if (player.name == "Warchief")
        {
            //CHECK GUAGE
            for (int i = 0; i < 3; i++)
            {
                if (player.GetComponent <Healthpoint>().fp >= player.GetComponent <SkillInfo>().warchiefMFC[i] * 100)
                {
                    UIskill[i].sprite = warchiefNM[i];
                }
                else
                {
                    UIskill[i].sprite = warchiefGS[i];
                }
            }

            for (int j = 0; j < 3; j++)
            {
                if (player.GetComponent <Healthpoint>().mp >= player.GetComponent <SkillInfo>().warchiefMFC[j + 3] * 100 &&
                    player.GetComponent <SkillInfo>().warchiefCD[j, 0] >= player.GetComponent <SkillInfo>().warchiefCD[j, 1])
                {
                    UIskill[j + 3].sprite = warchiefNM[j + 3];
                }
                else
                {
                    UIskill[j + 3].sprite = warchiefGS[j + 3];
                }
            }

            if (player.GetComponent <SkillInfo>().warchiefCD[3, 0] >= player.GetComponent <SkillInfo>().warchiefCD[3, 1])
            {
                UIskill[6].sprite = warchiefNM[6];
            }
            else
            {
                UIskill[6].sprite = warchiefGS[6];
            }

            //CHECK COOLDOWN
            for (int k = 0; k < 4; k++)
            {
                if (player.GetComponent <SkillInfo>().warchiefCD[k, 0] < player.GetComponent <SkillInfo>().warchiefCD[k, 1])
                {
                    UICDskill[k].SetActive(true);
                }
                else
                {
                    UICDskill[k].SetActive(false);
                }

                CDTime[k].text = (player.GetComponent <SkillInfo>().warchiefCD[k, 1] - player.GetComponent <SkillInfo>().warchiefCD[k, 0]).ToString();
            }
        }

        else if (player.name == "Berserker")
        {
            //CHECK GUAGE
            for (int i = 0; i < 3; i++)
            {
                if (player.GetComponent <Healthpoint>().fp >= player.GetComponent <SkillInfo>().berserkerMFC[i] * 100)
                {
                    UIskill[i].sprite = berserkerNM[i];
                }
                else
                {
                    UIskill[i].sprite = berserkerGS[i];
                }
            }

            for (int j = 0; j < 3; j++)
            {
                if (player.GetComponent <Healthpoint>().mp >= player.GetComponent <SkillInfo>().berserkerMFC[j + 3] * 100 &&
                    player.GetComponent <SkillInfo>().berserkerCD[j, 0] >= player.GetComponent <SkillInfo>().berserkerCD[j, 1])
                {
                    UIskill[j + 3].sprite = berserkerNM[j + 3];
                }
                else
                {
                    UIskill[j + 3].sprite = berserkerGS[j + 3];
                }
            }

            if (player.GetComponent <SkillInfo>().berserkerCD[3, 0] >= player.GetComponent <SkillInfo>().berserkerCD[3, 1])
            {
                UIskill[6].sprite = berserkerNM[6];
            }
            else
            {
                UIskill[6].sprite = berserkerGS[6];
            }

            //CHECK COOLDOWN
            for (int k = 0; k < 4; k++)
            {
                if (player.GetComponent <SkillInfo>().berserkerCD[k, 0] < player.GetComponent <SkillInfo>().berserkerCD[k, 1])
                {
                    UICDskill[k].SetActive(true);
                }
                else
                {
                    UICDskill[k].SetActive(false);
                }

                CDTime[k].text = (player.GetComponent <SkillInfo>().berserkerCD[k, 1] - player.GetComponent <SkillInfo>().berserkerCD[k, 0]).ToString();
            }
        }

        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //STATUS UI
        if (death)
        {
            death_b.SetActive(true);
        }
        else
        {
            death_b.SetActive(false);
        }

        if (status != null)
        {
            if (status == "Hack")
            {
                sts_b[int.Parse(etc) - 1].SetActive(true);
                joystick.SetActive(false);
                NetworkClientUI.SendJoystickInfo(0, 0);
            }
            else if (status == "Butch")
            {
                if (etc == "0")
                {
                    NetworkClientUI.SceneAdditive("Butch");
                }
                else if (etc == "1")
                {
                    NetworkClientUI.SceneSubitive("Butch");
                }
            }

            //Handheld.Vibrate(); //FOR MOBILE
            status = etc = null;
        }
    }