Beispiel #1
0
        public AnimationController(NavMeshAgent agent, AnimatorPlayableObject animatorPlayableObject, Rigidbody rigidbody,
                                   Action OnRootMotionEnabled = null, Action OnRootMotionDisabled = null)
        {
            Agent = agent;
            AnimatorPlayableObject = animatorPlayableObject;
            Rigidbody = rigidbody;

            this.RootMotionEnabled = new BoolVariable(false,
                                                      () =>
            {
                this.OnRootMotionEnabled();
                if (OnRootMotionEnabled != null)
                {
                    OnRootMotionEnabled.Invoke();
                }
            },
                                                      () =>
            {
                this.OnRootMotionDisabled();
                if (OnRootMotionDisabled != null)
                {
                    OnRootMotionDisabled.Invoke();
                }
            });
        }
Beispiel #2
0
        private void Start()
        {
            var animator = this.GetComponent <Animator>();

            this.AnimatorPlayableObject            = new AnimatorPlayableObject("Test", animator);
            this.TwoDObjectAnimationPlayableSystem = new TwoDObjectAnimationPlayableSystem(this.AnimatorPlayableObject, this.BlendTree);
        }
Beispiel #3
0
        public AnimatorPlayableGameObject(GameObject parent = null)
        {
            this.animatorPlayableGameObject = new GameObject();
            if (parent != null)
            {
                this.animatorPlayableGameObject.transform.parent = parent.transform;
                this.animatorPlayableGameObject.transform.ResetLocal();
            }

            this.Animator = this.animatorPlayableGameObject.AddComponent <Animator>();
            this.AnimatorPlayableObject   = new AnimatorPlayableObject("Test", this.Animator);
            this.animatorPlayableBehavior = this.animatorPlayableGameObject.AddComponent <AnimatorPlayableBehavior>();
            this.animatorPlayableBehavior.Init(this.AnimatorPlayableObject);
        }
Beispiel #4
0
 public TwoDObjectAnimationPlayableSystem(AnimatorPlayableObject AnimatorPlayableObject, A_AnimationPlayableDefinition Blendtree)
 {
     this.AnimatorPlayableObjectRef = AnimatorPlayableObject;
     AnimatorPlayableObject.PlayAnimation(0, Blendtree.GetAnimationInput());
 }
Beispiel #5
0
 public void Init(AnimatorPlayableObject AnimatorPlayableObject)
 {
     this.AnimatorPlayableObject = AnimatorPlayableObject;
 }
Beispiel #6
0
 private void Start()
 {
     this.AnimatorPlayableObject = new AnimatorPlayableObject("Test", this.GetComponent <Animator>());
     this.AnimatorPlayableObject.PlayAnimation(0, TwoDBlendTreePlayableDefinition.GetAnimationInput(), null, null);
 }