コード例 #1
0
        private void Update()
        {
            if (!isMoving)
            {
                if (isPlayerFacingMe)
                {
                    onInteract?.Invoke();
                }

                if (PS4.GetButtonDown(PS4.ButtonName.Circle))
                {
                    isMoving  = true;
                    isOpening = !isOpening;

                    if (doubleDoor.isMoving != true)
                    {
                        doubleDoor.OpenDoor(isOpening);
                    }

                    onLossInteract?.Invoke();
                }

                return;
            }

            if (isOpening)
            {
                transform.rotation = Quaternion.RotateTowards(transform.rotation, Quaternion.Euler(openPosition), 180 * Time.deltaTime);
                if (transform.rotation == Quaternion.Euler(openPosition))
                {
                    StartCoroutine(SetDelay());
                    isMoving = false;
                    enabled  = false;
                }
            }
            else
            {
                transform.rotation = Quaternion.RotateTowards(transform.rotation, Quaternion.Euler(closePosition), 180 * Time.deltaTime);
                if (transform.rotation == Quaternion.Euler(closePosition))
                {
                    StartCoroutine(SetDelay());
                    isMoving = false;
                    enabled  = false;
                }
            }
        }
コード例 #2
0
ファイル: Attacking.cs プロジェクト: wiratamana/Wira-Souls-2
        private void Update()
        {
            if (PS4.GetButtonDown(PS4.ButtonName.Triangle))
            {
                if (animParam.isAttacking || !animParam.isSword1h_Equip)
                {
                    return;
                }

                animator.Play(AnimName.SwordAnimsetPro.Sword1h_Attacks.i01_Attack_Move_slow_L_1);
                animParam.isAttacking = true;
                animParam.isMoving    = false;
                controller.StopRotating();
                target = GetTargetWithSmallestAngle();

                if (target != null)
                {
                    StartCoroutine(RotateTowardTarget());
                }
            }
        }
コード例 #3
0
        public void DoEquipHolster(PS4.ButtonName buttonName)
        {
            if (PS4.GetButtonDown(buttonName))
            {
                if (animParam.isAttacking || animParam.isHolsterOrEquip)
                {
                    return;
                }

                animParam.isMoving = false;
                controller.StopRotating();

                if (!animParam.isSword1h_Equip)
                {
                    Equip();
                }
                else
                {
                    Holster();
                }
            }
        }