12345678910111213141516171819202122232425262728293031323334 |
- using System;
- using System.Linq;
- using RootMotion.FinalIK;
- using UnityEngine;
- public abstract class LimbIKData : IKCtrlData
- {
- public LimbIKData(FullBodyIKCtrl ik_ctrl, FBIKChain chain, Transform tgt_bone, bool use_old = false) : base(ik_ctrl, tgt_bone, use_old, false)
- {
- this.Chain = chain;
- this.m_ChainBones = (from node in this.Chain.nodes
- select node.transform).ToArray<Transform>();
- }
- public override void SetPullState(bool pull_on)
- {
- if (this.m_OrijinPull < 0f)
- {
- this.m_OrijinPull = this.Chain.pull;
- }
- if (pull_on)
- {
- this.Chain.pull = this.m_OrijinPull;
- }
- else
- {
- this.Chain.pull = 0.1f;
- }
- }
- public readonly FBIKChain Chain;
- protected float m_OrijinPull = -1f;
- }
|