Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.R))
        {
            fightInit = true;
            startShowController.ShowStart(groundPool.transform.GetChild(centerIdx).position);
        }

        if (Input.GetKeyDown(KeyCode.C))
        {
            canCover = !canCover;
        }

        if (Input.GetKeyDown(KeyCode.H))
        {
            bool isHas = false;
            foreach (var v in allGcs)
            {
                if (v.linkData.Count != 0)
                {
                    Debug.Log(v.name);
                    isHas = true;
                }
            }
            if (!isHas)
            {
                Debug.Log("Clear");
            }
        }

        if (Input.GetKeyDown(KeyCode.J))
        {
            startShowController.ShowCount();
        }

        if (Input.GetKeyDown(KeyCode.Y))
        {
            fightController.ShowData();
        }
        if (Input.GetKey(KeyCode.K))
        {
            fightController.ShowSoulDataC();
        }

        if (Input.GetKeyDown(KeyCode.T))
        {
            fightController.TestFunction();
        }

        if (Input.GetKeyDown(KeyCode.O))
        {
            //fightController.ShowSkillData ();
        }


        if (Input.GetKeyDown(KeyCode.A))
        {
            if (CheckStatus(FightStatus.RoundStart) && spaceCount > 0)
            {
                CheckOut();
            }
        }

        if (Input.GetKeyDown(KeyCode.U))
        {
            ChangeStatus(FightStatus.SelSkillTarget);
        }

        if (CheckStatus(FightStatus.RoundStart))
        {
            if (Input.GetKeyDown(KeyCode.Mouse0))
            {
                TouchDown(false);
            }

            if (Input.GetKey(KeyCode.Mouse0))
            {
                TouchDrap(false);
            }

            if (Input.GetKeyUp(KeyCode.Mouse0))
            {
                TouchUp(false);
            }

            if (Input.touchCount == 1)
            {
                if (Input.GetTouch(0).phase == TouchPhase.Began)
                {
                    TouchDown(true);
                }

                if (Input.GetTouch(0).phase == TouchPhase.Stationary)
                {
                    TouchDrap(true);
                }

                if (Input.GetTouch(0).phase == TouchPhase.Ended)
                {
                    TouchUp(true);
                }
            }
        }

        if (onPress)
        {
            // 當前時間 -  最後按鈕按下時間 > 延遲1秒
            if (Time.time - lastIsDownTime > delay && !charaDetail)
            {
                SetCharaDetail((int)charaIdx);
                charaIdx    = null;
                charaDetail = true;
            }
        }
    }