Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using NodeCanvas.Framework;
- using ParadoxNotion.Design;
- using RootMotion.FinalIK;
- using UnityEngine;
- namespace NodeCavasAddons.FinalIK
- {
- [Category("FinalIK/Look At")]
- [Name("Simple Look At Target")]
- [Description("A simple task wrapping up underlying functionality to target directly from the IK")]
- [Icon("FinalIKLook")]
- [AgentType(typeof(LookAtIK))]
- public class SimpleLookAtTargetAction : ActionTask
- {
- [GetFromAgent]
- private LookAtIK _ik;
- [RequiredField]
- public BBParameter<GameObject> Effector;
- [RequiredField]
- [SliderField(0, 1.0f)]
- public BBParameter<float> PositionWeight;
- protected override string info
- {
- get { return string.Format("Look At Targetting {0}\nWith Weight {1}", Effector, PositionWeight); }
- }
- protected override void OnExecute()
- {
- _ik.solver.IKPosition = Effector.value.transform.position;
- _ik.solver.IKPositionWeight = PositionWeight.value;
- EndAction(true);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement