JointBase.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System;
  2. using UnityEngine;
  3. public abstract class JointBase : MonoBehaviour
  4. {
  5. public void Awake()
  6. {
  7. this.CreateDebugSelectMark();
  8. this.main_camera = GameMain.Instance.MainCamera.camera;
  9. }
  10. private void CreateDebugSelectMark()
  11. {
  12. if (base.transform.Find("SelectMark") != null)
  13. {
  14. return;
  15. }
  16. GameObject gameObject = new GameObject("SelectMark");
  17. gameObject.transform.SetParent(base.transform, false);
  18. gameObject.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f);
  19. Vector3[] array = new Vector3[]
  20. {
  21. new Vector3(3f, 0.1f, 0.1f),
  22. new Vector3(0.1f, 3f, 0.1f),
  23. new Vector3(0.1f, 0.1f, 3f)
  24. };
  25. for (int i = 0; i < array.Length; i++)
  26. {
  27. GameObject gameObject2 = GameObject.CreatePrimitive(PrimitiveType.Cube);
  28. gameObject2.name = "child_" + i.ToString();
  29. gameObject2.transform.SetParent(gameObject.transform, false);
  30. gameObject2.transform.localScale = array[i];
  31. }
  32. }
  33. public abstract void AddIkComponent(Maid target_maid);
  34. public Camera main_camera { get; private set; }
  35. }