private static void CreateInstance() { if (GUISharePic.mInstance != null) { return; } GameObject gameObject = Res.LoadGUI("GUI/GUISharePic"); if (gameObject == null) { global::Debug.LogError(new object[] { "Res.Load GUI/GUISharePic error" }); return; } GameObject gameObject2 = NGUITools.AddChild(GameUIManager.mInstance.uiRoot.gameObject, gameObject); if (gameObject2 == null) { global::Debug.LogError(new object[] { "AddChild GUISharePic error" }); return; } GUISharePic.mInstance = gameObject2.AddComponent<GUISharePic>(); int num = Screen.height; float num2 = GameUIManager.mInstance.uiRoot.GetPixelSizeAdjustment(num); num = Mathf.CeilToInt((float)num * num2); num2 = (float)num / 640f; gameObject2.transform.localPosition = new Vector3(0f, 0f, 10000f); gameObject2.transform.localScale = new Vector3(num2, num2, num2); GUISharePic.mInstance.screenScale = num2; }
public void DestroySelf() { UnityEngine.Object.Destroy(GUISharePic.mInstance.gameObject); GUISharePic.mInstance = null; }