コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        if (!isLocalPlayer)
        {
            return;
        }
        var x = xInput * movespeed * Time.deltaTime;

        transform.Translate(x, 0, 0);
        transform.position = new Vector3(Mathf.Clamp(transform.position.x, -boundary + playerDefaultPos.x, boundary + playerDefaultPos.x), playerDefaultPos.y, 0);
        if (Time.time > nextFire)
        {
            nextFire = Time.time + delayFire;
            CmdFire(0, 0, bulletSpawn[0].eulerAngles, bulletSpawn[0].up);
        }
        if (skillbuttonPressed != null)
        {
            if (skills[skillbuttonPressed.ID] == null)
            {
                return;
            }
            if (DimensionSupportTarget != null)
            {
                CmdSkillAction(DimensionSupportTarget.gameObject, skillbuttonPressed.ID);
                DimensionSupportTarget.AfterResetButton();
            }
            else
            {
                Debug.Log(skills [skillbuttonPressed.ID].coolTime);
                CmdSkillAction(null, skillbuttonPressed.ID);
            }
            skillbuttonPressed.cooltime = skills [skillbuttonPressed.ID].coolTime;
            StartCoroutine(skillbuttonPressed.coolTimeCoroutine());
            skillbuttonPressed = null;
        }
    }