当前位置: 首页>>代码示例>>C#>>正文


C# UIGrid.Reposition方法代码示例

本文整理汇总了C#中UIGrid.Reposition方法的典型用法代码示例。如果您正苦于以下问题:C# UIGrid.Reposition方法的具体用法?C# UIGrid.Reposition怎么用?C# UIGrid.Reposition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UIGrid的用法示例。


在下文中一共展示了UIGrid.Reposition方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IntilizationBlocksWaitForSecond

    public static void IntilizationBlocksWaitForSecond(UIGrid grid, int number, GameObject itemPre, List<GameObject> list, float time, float time2, Action<List<GameObject>> callback = null)
    {
        for (int i = 0; i < number; i++)
        {
            GameObject gameO = (GameObject)GameObject.Instantiate(itemPre);
            gameO.transform.parent = grid.transform;
            gameO.transform.localScale = Vector3.one;
            gameO.transform.localPosition = Vector3.one;
            gameO.name = i.ToString();
            list.Add(gameO);
        }
        Utility.instance.WaitForSecs(time, () =>
        {
            if(grid != null)
                grid.Reposition();
        });
        Utility.instance.WaitForSecs(time2, () =>
        {

            for (int i = 0; i < list.Count; i++)
            {
                if (list[i] != null)
                    list[i].SetActive(true);
            }
        });
    }
开发者ID:xiaozhuzhaoge,项目名称:Universal-Space,代码行数:26,代码来源:UISystem.cs

示例2: Start

	void Start () {
        grid = gridObject.GetComponent<UIGrid>();
        foreach (string spriteName in itemSprites)
        {
            GameObject go = NGUITools.AddChild(gridObject, itemPrefab);
            UISprite sprite = go.transform.FindChild("Item").GetComponent<UISprite>();
            sprite.spriteName = spriteName;
        }
        grid.Reposition();
	}
开发者ID:carvinchen,项目名称:tinybattle,代码行数:10,代码来源:LobbyManager.cs

示例3: LocalRefresh

	void LocalRefresh () {
		Util.DestroyChildren (instance.gameObject);
		
		foreach (Unit unit in UnitManager.GetUnitsInSlots()) {
			GameObject uiItem = Instantiate ( slotUIItem ) as GameObject;
			uiItem.transform.parent = transform;
			uiItem.GetComponent <SlotButton>().unit = unit;
			uiItem.GetComponent <UISprite>().spriteName = unit.spriteName;
		}
		
		uiGrid = GetComponent <UIGrid>();
		uiGrid.Reposition();
	}
开发者ID:keplergames,项目名称:TowerDefence2D,代码行数:13,代码来源:SlotUIManager.cs

示例4: IntilizationBlocks

	public static void IntilizationBlocks(UIGrid grid , int number, GameObject itemPre , List<GameObject> list)
    {
        for (int i = 0; i < number; i++)
        {
            GameObject gameO = (GameObject)GameObject.Instantiate(itemPre);
            gameO.transform.parent = grid.transform;
            gameO.transform.localScale = Vector3.one;
            gameO.transform.localPosition = Vector3.one;
            gameO.SetActive(true);
            gameO.name = i.ToString();
            list.Add(gameO);
        }
        grid.Reposition();
    }
开发者ID:xiaozhuzhaoge,项目名称:Universal-Space,代码行数:14,代码来源:UISystem.cs

示例5: CreateCardInstance

 private void CreateCardInstance(int cardId, bool isUsing, UIGrid parent)
 {
     this.CreateCardInstance(cardId, isUsing, parent.gameObject);
     parent.Reposition();
 }
开发者ID:weimingtom,项目名称:ACGCard-for-Unity3D,代码行数:5,代码来源:MenuScene.cs

示例6: Start

	void Start()
	{			
		MasterGrid = this.transform.GetComponent<UIGrid>();
		AchievementDisplay display = achievePrefab.GetComponent<AchievementDisplay>();
		GameObject newAchievementObj = null;
		
		for (int j = 0; j < Achievements.Length; j++) {
			//Fill achievements with current info
			Debug.Log ("AAUNITY/ACHIEVEMENT Achievement " + Achievements[j].Name + " is unlocked=" + db.isUnlocked(j+1));
			if(db.isUnlocked(j+1)) {
				Debug.Log("AAUNITY/ACHIEVEMENT Now set setting " + Achievements[j].Name + " to full progress of " + Achievements[j].TargetProgress);
				Achievements[j].SetProgress(Achievements[j].TargetProgress);
			}
			if(j >= 39 || (j >= 27 && j <= 29)) //for store and lifetime achievements show current progress
				Achievements[j].SetProgress((float)db.getProgress(j+1));
			
			// Get UI Label for name in child obj and set it to Achievments[j].name
			// Do this for description, points, and target
			display.nameLabel.text = Achievements[j].Name;
			display.descriptionLabel.text = Achievements[j].Description;
			display.targetLabel.text = Achievements[j].getProgress().ToString() + " / " + Achievements[j].TargetProgress.ToString();
			
			Debug.Log ("AAUNITY/ACHIEVEMENT Achievement " + Achievements[j].Name + " is Earned? " + Achievements[j].Earned);
			if(Achievements[j].Earned) {
				display.earned.SetActive(true);
				display.unearned.SetActive(false);
			} else {
				display.earned.SetActive(false);
				display.unearned.SetActive(true);
			}
			dragPanelContents = achievePrefab.GetComponent<UIDragPanelContents>();
			dragPanelContents.draggablePanel = MasterDragPanel;
			
			newAchievementObj = NGUITools.AddChild(MasterGrid.gameObject, achievePrefab.gameObject);
		}
		
		MasterGrid.Reposition();
		
	    ValidateAchievements();
        UpdateRewardPointTotals();
	}
开发者ID:CoderBear,项目名称:AAUnity,代码行数:41,代码来源:AchievementManager.cs

示例7: Start

    private void Start()
    {
        // Create Ranking Draggable Panel
        Transform grid_trans = transform.FindChild("DraggablePanel/Grid");
        //Transform grid_trans = transform.FindChild("Grid");
        if( grid_trans != null ){

            for(int i = 0; i < RANKING_LIST_NUM; ++i){
                GameObject panel = NGUITools.AddChild(grid_trans.gameObject, m_RankingPanel_Prefab);
                if( panel != null ){
                    panel.name = "Item_" + i.ToString("D2");
                    UIRankingPanel ranking_panel = panel.GetComponent<UIRankingPanel>();
                    m_RankingPanelList[i] = ranking_panel;
                }
            }

            Transform draggable_panel_trans = transform.FindChild("DraggablePanel");
            if( draggable_panel_trans != null ){
                m_DraggablePanel = draggable_panel_trans.gameObject.GetComponent<UIDraggablePanel>();
                if( m_DraggablePanel != null ){
                    m_OriginalClippingCenter_y = m_DraggablePanel.panel.clipRange.y;
                    m_OriginalLocalPosition_y  = m_DraggablePanel.transform.localPosition.y;

                    if( (m_DraggablePanel.verticalScrollBar != null) && (m_DraggablePanel.horizontalScrollBar != null) ){
                        m_DraggablePanel.UpdateScrollbars(true);
                        m_DraggablePanel.verticalScrollBar.scrollValue = 0.0f;
                    }
                }
            }

            m_UIGrid = grid_trans.gameObject.GetComponent<UIGrid>();
            if( m_UIGrid != null ){
                m_UIGrid.Reposition();
            }

            foreach(UIRankingPanel panel in m_RankingPanelList){
                panel.gameObject.isStatic = true;
                NGUITools.SetActive(panel.gameObject, false);
            }
        }

        Transform panel_middle = transform.FindChild("Panel Middle/Icon");
        if( panel_middle != null ){
            for(int i = 0; i < (int)SaveData.TRACK_RECORD.MAX_NUM; ++i ){
                m_MyTrackRecords[i] = panel_middle.FindChild("Sprite (rank_" + i.ToString("D2") + ")").gameObject;
                if( m_MyTrackRecords[i] != null ){
                    NGUITools.SetActive( m_MyTrackRecords[i], false);
                }
            }
        }
    }
开发者ID:Ginjack,项目名称:dir-kn,代码行数:51,代码来源:UIRanking.cs


注:本文中的UIGrid.Reposition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。