override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (firstSetting) { this.IKController = animator.GetComponent<IKControllerHumanoid>(); this.toKeepDistanceHash = Animator.StringToHash("ToKeepDistance"); this.rollingHash = Animator.StringToHash("Rolling"); this.controller = animator.GetComponent<ControllerAIHumanoid>(); this.firstSetting = false; } if (!controller.isServer) return; if (Random.Range(0, 4) == 0) { animator.SetBool(rollingHash, true); } IKController.SetDefaultWeaponTarget(); controller.RVOController.enableRotation = true; Vector3 thePointToFleeFrom = controller.CurrentEnemy.transform.position; int theGScoreToStopAt = 1000; FleePath path = FleePath.Construct(animator.transform.position, thePointToFleeFrom, theGScoreToStopAt); path.aimStrength = 10; controller.ManuallySetPath(path); }
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (firstSetting) { this.shootingHash = Animator.StringToHash("Shooting"); this.IKController = animator.GetComponent<IKControllerHumanoid>(); this.controller = animator.GetComponent<ControllerAIHumanoid>(); this.firstSetting = false; } }
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (firstSetting) { this.shootingHash = Animator.StringToHash("Shooting"); this.IKController = animator.GetComponent<IKControllerHumanoid>(); this.controller = animator.GetComponent<ControllerAIHumanoid>(); this.firstSetting = false; } if (!controller.isServer) return; IKController.SetWeaponTarget(controller.CurrentEnemy.transform); }