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


C# UIRoot类代码示例

本文整理汇总了C#中UIRoot的典型用法代码示例。如果您正苦于以下问题:C# UIRoot类的具体用法?C# UIRoot怎么用?C# UIRoot使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: Awake

 private void Awake()
 {
     if (this.Root == null)
     {
         this.Root = this.GetComponent<UIRoot>();
     }
 }
开发者ID:jixiang111,项目名称:slash-framework,代码行数:7,代码来源:UIScaleFixedWidth.cs

示例2: Form_Load

        private void Form_Load(object sender, EventArgs e)
        {
            {
                var camera = new Camera(
                    new vec3(0, 0, 5), new vec3(), new vec3(0, 1, 0),
                    CameraType.Perspecitive, this.glCanvas1.Width, this.glCanvas1.Height);
                var rotator = new SatelliteManipulater();
                rotator.Bind(camera, this.glCanvas1);
                this.camera = camera;
                this.rotator = rotator;
            }
            {
                var simplexNoiseRenderer = new SimplexNoiseRenderer();
                simplexNoiseRenderer.Name = string.Format("Pickable: [{0}]", "Sphere");
                simplexNoiseRenderer.Initialize();
                this.simplexNoiseRenderer = simplexNoiseRenderer;
            }
            {
                var UIRoot = new UIRoot();
                UIRoot.Initialize();
                this.uiRoot = UIRoot;

                var glAxis = new UIAxis(AnchorStyles.Right | AnchorStyles.Bottom,
                    new Padding(3, 3, 3, 3), new Size(70, 70), -100, 100);
                glAxis.Initialize();
                this.glAxis = glAxis;

                UIRoot.Children.Add(glAxis);
            }
            {
                var frmPropertyGrid = new FormProperyGrid();
                frmPropertyGrid.DisplayObject(this.simplexNoiseRenderer);
                frmPropertyGrid.Show();
            }
        }
开发者ID:chantsunman,项目名称:CSharpGL,代码行数:35,代码来源:Form13SimplexNoise.FormLoad.cs

示例3: Start

	// Use this for initialization
	
	void Start () {



		mRoot = NGUITools.FindInParents<UIRoot>(this.gameObject);
		
		Init();
		
		for (int i = 0; i < Button_SkillTypeChoise.Length; i++)
		{
			UIEventListener.Get(Button_SkillTypeChoise[i]).onClick = SkillTypeChoise;
		}
		for (int i = 0; i < Button_SkillSelect.Length; i++)
		{
			UIEventListener.Get(Button_SkillSelect[i].transform.FindChild("Button").gameObject).onClick = SkillSelect;
			UIEventListener.Get(Button_SkillSelect[i].transform.FindChild("Button").gameObject).onDragStart = SkillSelectDragStart;
			UIEventListener.Get(Button_SkillSelect[i].transform.FindChild("Button").gameObject).onDrag = SkillSelectDraging;
			UIEventListener.Get(Button_SkillSelect[i].transform.FindChild("Button").gameObject).onDragEnd = SkillSelectDragEnd;
		}
		for (int i = 0; i < Button_OpenClose.Length; i++)
		{
			UIEventListener.Get(Button_OpenClose[i]).onClick = OpenClose;
		}
		UIEventListener.Get(Button_HideShow).onClick = HideShow;
		UIEventListener.Get(Button_GoBack).onClick = GoBack;
	}
开发者ID:dev-celvin,项目名称:DK,代码行数:28,代码来源:UISkillEditController.cs

示例4: Initialize

	public void Initialize()
	{
		_panels = new List<PanelBase>();
		Root = GameObject.Find("UI Root").GetComponent<UIRoot>();

		Root.manualHeight = Screen.height;
		Root.manualWidth = Screen.width;

		UICamera = Root.transform.Find("UICamera").GetComponent<Camera>();


		BarkPanel = UICamera.transform.Find("BarkPanel").GetComponent<BarkPanel>();
		BarkPanel.Initialize();

		HUDPanel = UICamera.transform.Find("HUDPanel").GetComponent<HUDPanel>();
		HUDPanel.Initialize();

		WindowPanel = UICamera.transform.Find("WindowPanel").GetComponent<WindowPanel>();
		WindowPanel.Initialize();

		DialoguePanel = UICamera.transform.Find("DialoguePanel").GetComponent<DialoguePanel>();
		DialoguePanel.Initialize();


		_panels.Add(DialoguePanel);
		_panels.Add(WindowPanel);
		_panels.Add(HUDPanel);
		_panels.Add(BarkPanel);


		UIStateMachine = new UIStateMachine();
		UIStateMachine.Initialize();
	}
开发者ID:rotorist,项目名称:Warzone,代码行数:33,代码来源:UIManager.cs

示例5: Form_Load

        private void Form_Load(object sender, EventArgs e)
        {
            {
                var camera = new Camera(
                    new vec3(0, 0, 1), new vec3(0, 0, 0), new vec3(0, 1, 0),
                    CameraType.Perspecitive, this.glCanvas1.Width, this.glCanvas1.Height);
                var rotator = new SatelliteManipulater();
                rotator.Bind(camera, this.glCanvas1);
                this.camera = camera;
                this.rotator = rotator;
            }
            {
                var renderer = new AnalyzedPointSpriteRenderer(10000);
                renderer.Initialize();
                this.renderer = renderer;
            }
            {
                var UIRoot = new UIRoot();
                UIRoot.Initialize();
                this.uiRoot = UIRoot;

                var glAxis = new UIAxis(AnchorStyles.Right | AnchorStyles.Bottom,
                    new Padding(3, 3, 3, 3), new Size(70, 70), -100, 100);
                glAxis.Initialize();
                this.glAxis = glAxis;

                UIRoot.Children.Add(glAxis);
            }
            {
                var frmPropertyGrid = new FormProperyGrid();
                frmPropertyGrid.DisplayObject(this.renderer);
                frmPropertyGrid.Show();
                this.formPropertyGrid = frmPropertyGrid;
            }
        }
开发者ID:chantsunman,项目名称:CSharpGL,代码行数:35,代码来源:Form08AnalyzedPointSprite.Load.cs

示例6: Initialize

 /// <summary>
 /// Get references to the various UI panels
 /// </summary>
 public void Initialize()
 {
     planetMenu = GameObject.FindGameObjectWithTag("PlanetMenu").GetComponent<PlanetMenuControls>();
     shipDisplay = GameObject.FindGameObjectWithTag("ShipHUD").GetComponent<ShipHUDControls>();
     uiRoot = GameObject.FindWithTag("UIRoot").GetComponent<UIRoot>();
     labelPool = GameObject.FindWithTag("LabelPool").GetComponent<LabelPool>();
 }
开发者ID:adahera222,项目名称:Code,代码行数:10,代码来源:UI.cs

示例7: AdjustSize

 private void AdjustSize()
 {
     if (this.uiRoot == null)
     {
         if (GameUIManager.mInstance != null && GameUIManager.mInstance.uiRoot != null)
         {
             this.uiRoot = GameUIManager.mInstance.uiRoot;
         }
         else
         {
             GameObject root = NGUITools.GetRoot(base.gameObject);
             if (root != null)
             {
                 this.uiRoot = root.GetComponent<UIRoot>();
             }
         }
     }
     if (this.uiRoot == null)
     {
         return;
     }
     base.transform.localScale /= this.oldScale;
     this.oldScale = 1f;
     int num = this.uiRoot.activeHeight * Screen.width / Screen.height;
     if (num < 1024)
     {
         float d = (float)num / 1024f;
         base.transform.localScale *= d;
         this.oldScale = d;
     }
 }
开发者ID:floatyears,项目名称:Decrypt,代码行数:31,代码来源:UIScaleWeight.cs

示例8: Awake

    public void Awake()
    {
        Instance = this;
        _pool = new Queue<DamageNumber>();
        _uiRoot = FindObjectOfType<UIRoot>();

        WarmPool();
    }
开发者ID:CptDefault,项目名称:ggj2016,代码行数:8,代码来源:DamageNumberManager.cs

示例9: OnEnable

 private void OnEnable()
 {
     if (this.uiCamera == null)
     {
         this.uiCamera = NGUITools.FindCameraForLayer(base.gameObject.layer);
     }
     this.mRoot = NGUITools.FindInParents<UIRoot>(base.gameObject);
 }
开发者ID:HexHash,项目名称:LegacyRust,代码行数:8,代码来源:UIStretch.cs

示例10: Awake

 private void Awake()
 {
     mRoot = NGUITools.FindInParents<UIRoot>(transform);
     sprite = GetComponent<UISprite>();
     cachedHeight = sprite.height;
     cachedWidth = sprite.width;
     cachedPos = transform.localPosition;
 }
开发者ID:wuxin0602,项目名称:Nothing,代码行数:8,代码来源:StretchItem.cs

示例11: Start

	/// <summary>
	/// Automatically find the camera responsible for drawing the widgets under this object.
	/// </summary>

	void Start ()
	{
		mRoot = NGUITools.FindInParents<UIRoot>(gameObject);
		mIsWindows = (Application.platform == RuntimePlatform.WindowsPlayer ||
			Application.platform == RuntimePlatform.WindowsWebPlayer ||
			Application.platform == RuntimePlatform.WindowsEditor);

		if (uiCamera == null) uiCamera = NGUITools.FindCameraForLayer(gameObject.layer);
	}
开发者ID:btasdoven,项目名称:ScienceWars,代码行数:13,代码来源:UIAnchor.cs

示例12: Awake

	void Awake()
	{
		UIRoot[] roots = NGUITools.FindActive<UIRoot>();
		if (null != roots[0]) {
			_uIRoot = roots[0];
		}
		_cardToPresent = null;
		_didDragPastReleaseThreshold = false;
		HideCarousel(true);
	}
开发者ID:odasaburo,项目名称:ActiveLife,代码行数:10,代码来源:DynamicScrollView2.cs

示例13: Start

	/// <summary>
	/// Cache the root.
	/// </summary>

	void Start ()
	{
		mCam = GetComponent<Camera>();
		mTrans = transform;
		mRoot = NGUITools.FindInParents<UIRoot>(gameObject);

		if (rootForBounds == null)
		{
			Debug.LogError(NGUITools.GetHierarchy(gameObject) + " needs the 'Root For Bounds' parameter to be set", this);
			enabled = false;
		}
	}
开发者ID:StarkTT,项目名称:TestTask,代码行数:16,代码来源:UIDraggableCamera.cs

示例14: SetupDisplay

 // Retrieve references from current scene
 public static void SetupDisplay()
 {
     root = GameObject.Find("Root").GetComponent<UIRoot>();
     topLeft = GameObject.Find("TopLeft");
     top = GameObject.Find("Top");
     topRight = GameObject.Find("TopRight");
     left = GameObject.Find("Left");
     centre = GameObject.Find("Centre");
     right = GameObject.Find("Right");
     bottomLeft = GameObject.Find("BottomLeft");
     bottom = GameObject.Find("Bottom");
     bottomRight = GameObject.Find("BottomRight");
 }
开发者ID:hjrhjr,项目名称:Beats2,代码行数:14,代码来源:SceneScript.cs

示例15: Start

	/// <summary>
	/// Automatically find the camera responsible for drawing the widgets under this object.
	/// </summary>

	void Start ()
	{
		mRoot = NGUITools.FindInParents<UIRoot>(gameObject);
		mNeedsHalfPixelOffset = (Application.platform == RuntimePlatform.WindowsPlayer ||
			Application.platform == RuntimePlatform.WindowsWebPlayer ||
			Application.platform == RuntimePlatform.WindowsEditor);

		// Only DirectX 9 needs the half-pixel offset
		if (mNeedsHalfPixelOffset) mNeedsHalfPixelOffset = (SystemInfo.graphicsShaderLevel < 40);

		if (uiCamera == null) uiCamera = NGUITools.FindCameraForLayer(gameObject.layer);
		Update();
	}
开发者ID:kockaart,项目名称:Assets-product-catcher,代码行数:17,代码来源:UIAnchor.cs


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