本文整理汇总了C#中UIRoot类的典型用法代码示例。如果您正苦于以下问题:C# UIRoot类的具体用法?C# UIRoot怎么用?C# UIRoot使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UIRoot类属于命名空间,在下文中一共展示了UIRoot类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: Start
private void Start()
{
if ((this.container == null) && (this.widgetContainer != null))
{
this.container = this.widgetContainer.gameObject;
this.widgetContainer = null;
}
if (this.uiCamera == null)
{
this.uiCamera = NGUITools.FindCameraForLayer(base.gameObject.layer);
}
this.mRoot = NGUITools.FindInParents<UIRoot>(base.gameObject);
this.Update();
}
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:14,代码来源:UIStretch.cs
示例17: PreCreate
private static void PreCreate ()
{
if (m_uiRoot == null)
{
int uiLayer = LayerMask.NameToLayer("UI");
m_uiRootObj = new GameObject("UI Root(2D)");
m_uiRootObj.layer = uiLayer;
UIRoot uiRoot = m_uiRootObj.AddComponent<UIRoot>();
{
uiRoot.scalingStyle = UIRoot.Scaling.FixedSize;
if ((Double)Screen.width / Screen.height < 1.49)
uiRoot.manualHeight = 768;
else
uiRoot.manualHeight = 640;
}
m_cameraObj = new GameObject("Camera");
m_cameraObj.transform.parent = m_uiRootObj.transform;
m_camera = m_cameraObj.AddComponent<Camera>();
{
float depth = -1f;
m_camera.gameObject.layer = uiLayer;
m_camera.depth = depth + 1;
m_camera.backgroundColor = Color.black;
m_camera.cullingMask = 1 << uiLayer;
//Use Simple2D Camera
m_camera.orthographicSize = 1f;
m_camera.orthographic = true;
m_camera.nearClipPlane = -2f;
m_camera.farClipPlane = 2f;
m_camera.gameObject.AddComponent<UICamera>();
//m_camera.gameObject.AddComponent<UITick>();
}
m_uiCamera = m_cameraObj.AddComponent<UICamera>();
m_uiRootObj.AddComponent<UIPanel>();
m_uiRoot = uiRoot;
}
}
开发者ID:fengqk,项目名称:Art,代码行数:49,代码来源:GUIRoot.cs
示例18: Start
void Start()
{
mRoot = GetComponent<UIRoot>();
if (mRoot == null)
{
Destroy(this);
return;
}
// 计算基准宽高比
Base_Aspect = mRoot.manualWidth * 1.0f / mRoot.manualHeight;
// 手机平台上RunOnce
if (Settings.isMobilePlatform)
{
Update();
Destroy(this);
}
}
开发者ID:zeronely,项目名称:View,代码行数:17,代码来源:UIRootAdapter.cs
示例19: FindControls
/// <summary>
/// Makes sure we have a UIRoot and logs warnings if any critical controls are unassigned.
/// </summary>
private void FindControls() {
if (uiRoot == null) uiRoot = GetComponentInChildren<UIRoot>();
nguiUIRoot = new NGUIUIRoot(uiRoot, deactivateUIRootWhenHidden);
nguiQTEControls = new NGUIQTEControls(qteIndicators);
SetupContinueButton(dialogue.npcSubtitle.continueButton);
SetupContinueButton(dialogue.pcSubtitle.continueButton);
SetupContinueButton(alert.continueButton);
if (DialogueDebug.LogErrors) {
if (uiRoot == null) Debug.LogError(string.Format("{0}: NGUIDialogueUI can't find UIRoot and won't be able to display dialogue.", DialogueDebug.Prefix));
if (DialogueDebug.LogWarnings) {
if (dialogue.npcSubtitle.line == null) Debug.LogWarning(string.Format("{0}: NGUIDialogueUI NPC Subtitle Line needs to be assigned.", DialogueDebug.Prefix));
if (dialogue.pcSubtitle.line == null) Debug.LogWarning(string.Format("{0}: NGUIDialogueUI PC Subtitle Line needs to be assigned.", DialogueDebug.Prefix));
if (dialogue.responseMenu.buttons.Length == 0) Debug.LogWarning(string.Format("{0}: NGUIDialogueUI Response buttons need to be assigned.", DialogueDebug.Prefix));
if (alert.line == null) Debug.LogWarning(string.Format("{0}: NGUIDialogueUI Alert Line needs to be assigned.", DialogueDebug.Prefix));
}
}
}
开发者ID:cupsster,项目名称:gtmanager,代码行数:20,代码来源:NGUIDialogueUI.cs
示例20: Start
private void Start()
{
if ((this.container == null) && (this.widgetContainer != null))
{
this.container = this.widgetContainer.gameObject;
this.widgetContainer = null;
}
this.mRoot = NGUITools.FindInParents<UIRoot>(base.gameObject);
this.mNeedsHalfPixelOffset = (((Application.platform == RuntimePlatform.WindowsPlayer) || (Application.platform == RuntimePlatform.XBOX360)) || (Application.platform == RuntimePlatform.WindowsWebPlayer)) || (Application.platform == RuntimePlatform.WindowsEditor);
if (this.mNeedsHalfPixelOffset)
{
this.mNeedsHalfPixelOffset = SystemInfo.graphicsShaderLevel < 40;
}
if (this.uiCamera == null)
{
this.uiCamera = NGUITools.FindCameraForLayer(base.gameObject.layer);
}
this.Update();
}
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:19,代码来源:UIAnchor.cs
注:本文中的UIRoot类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论