AdjustObjHeightToMaidBone.cs 844 B

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. using UnityEngine;
  3. public class AdjustObjHeightToMaidBone : MonoBehaviour
  4. {
  5. private void Awake()
  6. {
  7. this.m_myTransform = base.transform;
  8. }
  9. public void Adjust(int maidNo, string boneNameY)
  10. {
  11. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(maidNo);
  12. if (maid == null)
  13. {
  14. Debug.LogError("AdjustObjHeightToMaidBone メイド番号:" + maidNo + "は居ません。");
  15. return;
  16. }
  17. Transform transform = CMT.SearchObjName(maid.body0.m_trBones, boneNameY, true);
  18. if (transform == null)
  19. {
  20. Debug.LogError("AdjustObjHeightToMaidBone ボーン名:" + boneNameY + "は見つかりません。");
  21. return;
  22. }
  23. this.m_myTransform.position = new Vector3(this.m_myTransform.position.x, transform.position.y, this.m_myTransform.position.z);
  24. }
  25. private void Update()
  26. {
  27. }
  28. private Transform m_myTransform;
  29. }