using System; using UnityEngine; namespace kt.ik { public class IKAttachParam { public IKAttachParam(Maid src_chara = null, Maid target_chara = null) { this.srcChara = src_chara; this.targetChara = target_chara; this.offsetEnable.Reset(); } public int slotNo { get { return (!this.targetChara || !this.targetChara.body0.IsSlotNo(this.slotName)) ? -1 : this.targetChara.body0.GetSlotNo(this.slotName); } } public string axisBoneName { get { return (!this.axisBone) ? string.Empty : this.axisBone.name; } set { if (this.targetChara) { this.axisBone = this.targetChara.body0.GetBone(value); } } } public string targetBoneName { get { return (this.odoguObj || !this.attachTarget) ? string.Empty : this.attachTarget.name; } set { if (this.targetChara) { this.attachTarget = this.targetChara.body0.GetBone(value); } } } public GameObject odoguObj { get; private set; } public string odoguName { get { return (!this.odoguObj) ? string.Empty : this.odoguObj.name; } set { this.odoguObj = GameMain.Instance.BgMgr.GetPrefabFromBg(value); if (this.odoguObj && !this.attachTarget) { this.attachTarget = this.odoguObj.transform; } } } public string odoguTgtName { get { return (!this.odoguObj || !this.attachTarget) ? string.Empty : this.attachTarget.name; } set { if (!this.odoguObj) { return; } Transform exists = this.odoguObj.transform.Find(value); if (exists) { this.attachTarget = exists; } } } public string attachIKName { get { return this.AttachIKName; } set { if (!this.targetChara) { return; } this.AttachIKName = value; AIKCtrl ikctrl = this.targetChara.body0.fullBodyIK.GetIKCtrl(this.AttachIKName); if (ikctrl) { this.attachTarget = ikctrl.bone; } } } public Maid srcChara; public Maid targetChara; public AIKCtrl.IKAttachType attachType = AIKCtrl.IKAttachType.NewPoint; public AIKCtrl.IKExecTiming execTiming; public Transform attachTarget; public string slotName = string.Empty; public string attachPointName = string.Empty; public Transform axisBone; private string AttachIKName = string.Empty; public AIKCtrl.PosRotPair virtualPosRot = new AIKCtrl.PosRotPair(Vector3.zero, Quaternion.identity); public Vector3 offset = Vector3.zero; public bool doAnimation; public AIKCtrl.Vec3Enable offsetEnable; public float blendTime; public AIKCtrl.PosOffsetType posOffsetType; public bool bodyPull = true; } }