Inheritance: NetworkBehaviour
コード例 #1
0
    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);
    }
コード例 #2
0
 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;
     }
 }
コード例 #3
0
    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);
    }