Test.cs 527 B

1234567891011121314151617181920212223242526
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. public class Test : MonoBehaviour
  5. {
  6. public static Test Instance;
  7. public GameObject GameObject;
  8. public void Awake()
  9. {
  10. Instance = this;
  11. DontDestroyOnLoad(transform.parent.gameObject);
  12. }
  13. public void SetGo(Vector3 pos, Transform parent)
  14. {
  15. //GameObject.transform.SetParent(parent);
  16. //GameObject.transform.localPosition = pos;
  17. GameObject.transform.position = pos;
  18. }
  19. }