Ejemplo n.º 1
0
    /// <summary>
    /// Set up everything necessary to preview a UI object.
    /// </summary>

    static bool SetupPreviewForUI(Camera cam, GameObject root, GameObject child, UISnapshotPoint point)
    {
        if (child.GetComponentInChildren <UIRect>() == null)
        {
            return(false);
        }

        if (child.GetComponent <UIPanel>() == null)
        {
            root.AddComponent <UIPanel>();
        }

        Bounds  bounds  = NGUIMath.CalculateAbsoluteWidgetBounds(child.transform);
        Vector3 size    = bounds.extents;
        float   objSize = size.magnitude;

        cam.transform.position = bounds.center;
        cam.cullingMask        = (1 << root.layer);

        if (point != null)
        {
            SetupSnapshotCamera(child, cam, point);
        }
        else
        {
            SetupSnapshotCamera(child, cam, objSize, Mathf.RoundToInt(Mathf.Max(size.x, size.y)), -100f, 100f);
        }
        NGUITools.ImmediatelyCreateDrawCalls(root);
        return(true);
    }
Ejemplo n.º 2
0
    public void UpdateList()
    {
        GameObject tmp;

        ReadDirectory();

        foreach (Transform child in t_saveList)
        {
            Destroy(child.gameObject);
        }

        foreach (string s in list)
        {
            tmp = Instantiate(savePrefab, new Vector3(0, 0, 0), Quaternion.identity, t_saveList) as GameObject;
            tmp.GetComponent <ChangeColor>().ChangeName(s);
        }
        NGUITools.ImmediatelyCreateDrawCalls(saveList);
        saveList.GetComponent <UITable>().Reposition();
        NGUITools.ImmediatelyCreateDrawCalls(saveList);

        Component[] components = saveList.GetComponentsInChildren <ChangeColor>();
        foreach (ChangeColor ch in components)
        {
            ch.Selected += saveMenuItemSelected;
        }
    }
Ejemplo n.º 3
0
    static int ImmediatelyCreateDrawCalls(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 1);
        GameObject arg0 = (GameObject)LuaScriptMgr.GetUnityObject(L, 1, typeof(GameObject));

        NGUITools.ImmediatelyCreateDrawCalls(arg0);
        return(0);
    }
Ejemplo n.º 4
0
 public void Initialize(int realIndex, ShipModel model)
 {
     mRealIndex = realIndex;
     mShipModel = model;
     mTexture_ShipBanner.mainTexture = UIScrollListTest.sShipBannerManager.GetShipBanner(mShipModel);
     mLabel_ShipName.text            = mShipModel.Name;
     NGUITools.ImmediatelyCreateDrawCalls(base.gameObject);
     mWidgetThis.alpha = 1f;
     base.name         = "[" + realIndex + "]【" + model.Name + "】";
 }
Ejemplo n.º 5
0
	static public int ImmediatelyCreateDrawCalls_s(IntPtr l) {
		try {
			UnityEngine.GameObject a1;
			checkType(l,1,out a1);
			NGUITools.ImmediatelyCreateDrawCalls(a1);
			pushValue(l,true);
			return 1;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
Ejemplo n.º 6
0
 static int ImmediatelyCreateDrawCalls(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckUnityObject(L, 1, typeof(UnityEngine.GameObject));
         NGUITools.ImmediatelyCreateDrawCalls(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 7
0
    private static int ImmediatelyCreateDrawCalls(IntPtr L)
    {
        int result;

        try
        {
            ToLua.CheckArgsCount(L, 1);
            GameObject root = (GameObject)ToLua.CheckUnityObject(L, 1, typeof(GameObject));
            NGUITools.ImmediatelyCreateDrawCalls(root);
            result = 0;
        }
        catch (Exception e)
        {
            result = LuaDLL.toluaL_exception(L, e, null);
        }
        return(result);
    }
Ejemplo n.º 8
0
    private static void FindAndRefreshPanels(Transform t)
    {
        var panel = t.GetComponent <UIPanel>();

        if (panel != null && panel.gameObject.activeInHierarchy)
        {
            NGUITools.ImmediatelyCreateDrawCalls(panel.gameObject);
        }
        else
        {
            // This is wrapped in an else block because there is no need to go deeper if a panel was found
            for (int i = 0, count = t.childCount; i < count; ++i)
            {
                FindAndRefreshPanels(t.GetChild(i));
            }
        }
    }
Ejemplo n.º 9
0
 public void Initialize(int realIndex, ShipModel model)
 {
     this.mRealIndex = realIndex;
     this.mShipModel = model;
     this.mTexture_ShipBanner.mainTexture = UIScrollListTest.sShipBannerManager.GetShipBanner(this.mShipModel);
     this.mLabel_ShipName.text            = this.mShipModel.Name;
     NGUITools.ImmediatelyCreateDrawCalls(base.get_gameObject());
     this.mWidgetThis.alpha = 1f;
     base.set_name(string.Concat(new object[]
     {
         "[",
         realIndex,
         "]【",
         model.Name,
         "】"
     }));
 }
Ejemplo n.º 10
0
    void CreateMemoriesList()
    {
        if (!cameFromEditPhoto)
        {
            memoryList = new List <Memory> ();

            for (int i = 0; i < Config.currentChildDayMemoriesCount; i++)
            {
                Memory newMemory = Instantiate(currentMemory, new Vector3(0, -900, 0), Quaternion.identity) as Memory;
                newMemory.transform.parent     = scrollTableView.transform;
                newMemory.transform.localScale = new Vector3(1, 1, 1);
                newMemory.GetComponent <UIDragScrollView> ().scrollView = scrollView;
                memoryList.Add(newMemory);

                EventDelegate.Add(newMemory.GetComponent <UIButton> ().onClick, delegate() {
                    memoryFull.UpdateData(newMemory);
                });
            }
        }

        NGUITools.ImmediatelyCreateDrawCalls(scrollTableView.gameObject);
        LoadPhotoAndText();
    }