Пример #1
0
 void Awake()
 {
     // Make sure the menu is singleton
     if (singleton == null)
     {
         singleton = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Пример #2
0
    public void Awake()
    {
        Singleton         = GameObject.FindWithTag("Singleton").GetComponent <SingletonControl>();
        MainCamera        = Singleton.Camera.GetComponent <Camera>().gameObject;
        MarkerEnvironment = Singleton.Environment;

        foreach (GameObject Object in CameraObject)
        {
            Object.transform.SetParent(MainCamera.transform);
            Object.transform.localPosition = Vector3.zero;
            Object.transform.localRotation = Quaternion.identity;
        }
        foreach (GameObject Object in SceneObject)
        {
            Object.transform.SetParent(Singleton.Environment.transform);
        }
    }