123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- 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;
- }
- }
|