TestMenu.cs 588 B

123456789101112131415161718192021222324252627282930
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class TestMenu : MonoBehaviour
  5. {
  6. public GameObject Menu;
  7. public Transform menuParent;
  8. public Vector3 startPos;
  9. public Vector3 startRot;
  10. private void OnEnable()
  11. {
  12. Menu.SetActive(true);
  13. Menu.transform.position = menuParent.position;
  14. Menu.transform.eulerAngles = new Vector3(20, menuParent.eulerAngles.y, menuParent.eulerAngles.z);
  15. }
  16. private void OnDisable()
  17. {
  18. if(Menu!=null)
  19. Menu.SetActive(false);
  20. }
  21. }