shuxing.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. [ExecuteInEditMode]
  5. public class shuxing : MonoBehaviour
  6. {
  7. // Start is called before the first frame update
  8. public float Age=1;
  9. public List<GameObject> Angle_Obj;
  10. bool aa=false;
  11. void Start()
  12. {
  13. }
  14. private void OnEnable()
  15. {
  16. // Angle_Obj.Add(this.gameObject.transform.GetChild(0).gameObject);
  17. }
  18. //public float Age
  19. //{
  20. // get
  21. // {
  22. // Debug.Log("bbbbbbb" + aaage);
  23. // return aaage;
  24. // }
  25. // set
  26. // {
  27. // Debug.Log("bbbbbbb");
  28. // aaage = value;
  29. // }
  30. //}
  31. // Update is called once per frame
  32. void Update()
  33. {
  34. Debug.Log(this.gameObject.transform.GetChild(0).gameObject);
  35. if (aa == false && this.gameObject.transform.GetChild(0).gameObject != null)
  36. {
  37. // Angle_Obj.Add(this.gameObject.transform.GetChild(0).gameObject);
  38. aa = true;
  39. //for (int i = 0; i < Angle_Obj.Count; i++)
  40. //{
  41. // Debug.Log(Angle_Obj[i].name);
  42. //}
  43. }
  44. this.gameObject.transform.GetChild(0).transform.localScale = new Vector3(Age, Age, 1);
  45. }
  46. }