Exemplo n.º 1
0
 public static Object SafeInstantiate(Object original, Vector3 position, Quaternion rotation)
 {
     if (NcSafeTool.m_bShuttingDown)
     {
         return(null);
     }
     if (NcSafeTool.s_Instance == null)
     {
         NcSafeTool.Instance();
     }
     return(Object.Instantiate(original, position, rotation));
 }
Exemplo n.º 2
0
    public static GameObject CreateGameObject(Transform parent, GameObject prefabObj)
    {
        GameObject gameObject = (GameObject)NcSafeTool.SafeInstantiate(prefabObj);

        if (parent != null)
        {
            NcTransformTool ncTransformTool = new NcTransformTool(gameObject.get_transform());
            gameObject.get_transform().set_parent(parent);
            ncTransformTool.CopyToLocalTransform(gameObject.get_transform());
        }
        return(gameObject);
    }
Exemplo n.º 3
0
 public static Object SafeInstantiate(Object original)
 {
     if (NcSafeTool.m_bShuttingDown)
     {
         return(null);
     }
     if (NcSafeTool.s_Instance == null)
     {
         NcSafeTool.Instance();
     }
     return(Object.Instantiate(original));
 }
Exemplo n.º 4
0
    public static GameObject CreateGameObject(Transform parent, GameObject prefabObj)
    {
        GameObject newChild = (GameObject)NcSafeTool.SafeInstantiate(prefabObj);

        if (parent != null)
        {               // 盔夯 transform阑 蜡瘤 矫难林磊
            NcTransformTool trans = new NcTransformTool(newChild.transform);
            newChild.transform.parent = parent;
            trans.CopyToLocalTransform(newChild.transform);
        }
        return(newChild);
    }
Exemplo n.º 5
0
	// Property -------------------------------------------------------------------------
	private static void Instance()
	{
		if (s_Instance == null)
		{
			GameObject gm;
			gm = UnityEngine.GameObject.Find("_GlobalManager");
			if (gm == null)
				gm = new GameObject("_GlobalManager");
			else s_Instance = (NcSafeTool)gm.GetComponent(typeof(NcSafeTool));
			if (s_Instance == null)
				s_Instance = (NcSafeTool)gm.AddComponent(typeof(NcSafeTool));
		}
	}
Exemplo n.º 6
0
 public static void LoadLevel(int nLoadLevel)
 {
     if (NcSafeTool.m_bShuttingDown)
     {
         return;
     }
     if (NcSafeTool.s_Instance == null)
     {
         NcSafeTool.Instance();
     }
     NcSafeTool.m_bLoadLevel = true;
     Debuger.Info("Safe LoadLevel start " + nLoadLevel, new object[0]);
     SceneManager.LoadScene(nLoadLevel);
     Debuger.Info("Safe LoadLevel end", new object[0]);
     NcSafeTool.m_bLoadLevel = false;
 }
Exemplo n.º 7
0
 public static void LoadLevel(int nLoadLevel)
 {
     if (NcSafeTool.m_bShuttingDown)
     {
         return;
     }
     if (NcSafeTool.s_Instance == null)
     {
         NcSafeTool.Instance();
     }
     NcSafeTool.m_bLoadLevel = true;
     Debug.Log("Safe LoadLevel start " + nLoadLevel);
     Application.LoadLevel(nLoadLevel);
     Debug.Log("Safe LoadLevel end");
     NcSafeTool.m_bLoadLevel = false;
 }
Exemplo n.º 8
0
    public static GameObject CreateGameObject(Transform parent, GameObject prefabObj, Vector3 pos, Quaternion rot)
    {
        if (!NcSafeTool.IsSafe())
        {
            return(null);
        }
        GameObject gameObject = (GameObject)NcSafeTool.SafeInstantiate(prefabObj, pos, rot);

        if (parent != null)
        {
            NcTransformTool ncTransformTool = new NcTransformTool(gameObject.get_transform());
            gameObject.get_transform().set_parent(parent);
            ncTransformTool.CopyToLocalTransform(gameObject.get_transform());
        }
        return(gameObject);
    }
Exemplo n.º 9
0
    public static GameObject CreateGameObject(Transform parent, GameObject prefabObj, Vector3 pos, Quaternion rot)
    {
        GameObject newChild;

        if (NcSafeTool.IsSafe() == false)
        {
            return(null);
        }
        newChild = (GameObject)NcSafeTool.SafeInstantiate(prefabObj, pos, rot);
        if (parent != null)
        {               // 盔夯 transform阑 蜡瘤 矫难林磊
            NcTransformTool trans = new NcTransformTool(newChild.transform);
            newChild.transform.parent = parent;
            trans.CopyToLocalTransform(newChild.transform);
        }
        return(newChild);
    }
Exemplo n.º 10
0
 private static void Instance()
 {
     if (NcSafeTool.s_Instance == null)
     {
         GameObject gameObject = GameObject.Find("_GlobalManager");
         if (gameObject == null)
         {
             gameObject = new GameObject("_GlobalManager");
         }
         else
         {
             NcSafeTool.s_Instance = (NcSafeTool)gameObject.GetComponent(typeof(NcSafeTool));
         }
         if (NcSafeTool.s_Instance == null)
         {
             NcSafeTool.s_Instance = (NcSafeTool)gameObject.AddComponent(typeof(NcSafeTool));
         }
     }
 }
Exemplo n.º 11
0
 // Property -------------------------------------------------------------------------
 private static void Instance()
 {
     if (s_Instance == null)
     {
         GameObject gm;
         gm = UnityEngine.GameObject.Find("_GlobalManager");
         if (gm == null)
         {
             gm = new GameObject("_GlobalManager");
         }
         else
         {
             s_Instance = (NcSafeTool)gm.GetComponent(typeof(NcSafeTool));
         }
         if (s_Instance == null)
         {
             s_Instance = (NcSafeTool)gm.AddComponent(typeof(NcSafeTool));
         }
     }
 }
Exemplo n.º 12
0
    public static GameObject CreateGameObject(GameObject prefabObj)
    {
        GameObject newChild = (GameObject)NcSafeTool.SafeInstantiate(prefabObj);

        return(newChild);
    }
Exemplo n.º 13
0
 public static GameObject CreateGameObject(GameObject prefabObj)
 {
     return((GameObject)NcSafeTool.SafeInstantiate(prefabObj));
 }