private void Shouting() { AnimatorStateInfo state = animator.GetCurrentAnimatorStateInfo(0); if (state.IsName("BaseLayer.Shouting")) { if (state.normalizedTime > 0.9) { currentMotionState = MotionState.Idling; animator.SetBool("Shouting", false); shoutingCount = 0; } if (state.normalizedTime > 0.20f && state.normalizedTime < 0.55f) { if (!audioSource.isPlaying) { audioSource.Play(); } } } else { animator.SetBool("Shouting", true); transform.LookAt(sensorController.GetNearByPlayer()); } }
void Update() { if (motionController.CurrentMotionState == MotionState.Dead) { return; } if (health <= 0) { motionController.DeadTrigger(); return; } Transform player = sensorController.GetNearByPlayer(); if (player == null) { return; } if (SpinKickAble(player, motionController.CurrentMotionState)) { if (CrossPlatformInputManager.GetButton("J")) { PlayerMotionController pmc = player.GetComponent <PlayerMotionController>(); pmc.SpinKickTrigger(); } } }
void Update() { if (GameManager.Instance.CurrentGameState != GameManager.GameState.Play) { return; } Transform player = sensorController.GetNearByPlayer(); if (player == null) { return; } if (attackFlag) { return; } if (motionController.CurrentMotionState == MotionState.Attacking) { AnimatorStateInfo state = animator.GetCurrentAnimatorStateInfo(0); if (state.IsName("BaseLayer.Attack")) { if (state.normalizedTime >= 0.2 && state.normalizedTime <= 0.4) { if (Vector3.Distance(player.position, transform.position) > attackRadius) { return; } Vector3 direction = player.position - transform.position; float angle = Vector3.Angle(transform.forward, direction); if (angle <= attackAngle / 2 && angle >= -attackAngle / 2) { if (playerHealth == null) { playerHealth = player.GetComponent <PlayerHealthManager>(); } playerHealth.WasHitFly(transform.position, hitFlyDistance, damage); } } } } }