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


C# Level.GetComponent方法代码示例

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


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

示例1: OnLevelChange

	void OnLevelChange (Level level) 
	{
		var scoreComp = level.GetComponent<ScoreCounter> ();
		if (scoreComp != null)
			scoreComp.OnScoreChange += OnScoreUpdate;

		var goal = level.GetComponent<GoalController>();
		if ( goal != null )
		{
			if ( goal.TotalWindows > 0 )
			{
				TotalWindows.text = goal.TotalWindows.ToString();

				goal.OnWindowsChange += OnWindowsUpdate;
			}

			if (goal.TotalScore > 0)
			{
				TotalScore.text = goal.TotalScore.ToString();
			}

			OnWindowsUpdate(0);
			OnScoreUpdate(0);
		}

		m_levelLabel.text = level.Number.ToString();
	}
开发者ID:mahnovsky,项目名称:PT,代码行数:27,代码来源:UITopPanel.cs

示例2: OpenLevelDialog

    public void OpenLevelDialog(Level level)
    {
        if (level.IsActive && level.GetComponent<Toggle>().isOn)
        {
            _listOfViews[(int) ViewEnums.LevelDialog].SetActive(true);

            GameObject child =
                _listOfViews[(int) ViewEnums.LevelDialog].transform.FindChild("ResponsiveWindow(LevelDialog)")
                    .gameObject;
            GameObject banner = child.transform.FindChild("Header").gameObject;
            GameObject textObj = banner.transform.FindChild("Text").gameObject;
            textObj.GetComponent<Text>().text = level.Name;

            //To make level loadable
            _selectedLevelDialog = level;
        }
    }
开发者ID:Niklas83,项目名称:UnityGame1,代码行数:17,代码来源:GUILogic.cs

示例3: OnEnable

    void OnEnable()
    {
        // Note that non static vars are uninitialized whenever the editor is deselected.
        // That's why I've taken out "if(not init...)" because always null values when this function called. Will have to use static for undos etc later
        _level = (Level)target;
        _mesh = GetMesh();
        _collider = _level.GetComponent<MeshCollider>();
        _lastTool = Tools.current;

        if(_level.faces == null) CalculateFaces(); // calc them faces if never been done before
        InitTiles();
    }
开发者ID:LGriggles,项目名称:Trout-Run,代码行数:12,代码来源:LevelEditor.cs


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