本文整理汇总了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>();
}
}
示例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();
}
}
示例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;
}
示例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();
}
示例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;
}
}
示例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>();
}
示例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;
}
}
示例8: Awake
public void Awake()
{
Instance = this;
_pool = new Queue<DamageNumber>();
_uiRoot = FindObjectOfType<UIRoot>();
WarmPool();
}
示例9: OnEnable
private void OnEnable()
{
if (this.uiCamera == null)
{
this.uiCamera = NGUITools.FindCameraForLayer(base.gameObject.layer);
}
this.mRoot = NGUITools.FindInParents<UIRoot>(base.gameObject);
}
示例10: Awake
private void Awake()
{
mRoot = NGUITools.FindInParents<UIRoot>(transform);
sprite = GetComponent<UISprite>();
cachedHeight = sprite.height;
cachedWidth = sprite.width;
cachedPos = transform.localPosition;
}
示例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);
}
示例12: Awake
void Awake()
{
UIRoot[] roots = NGUITools.FindActive<UIRoot>();
if (null != roots[0]) {
_uIRoot = roots[0];
}
_cardToPresent = null;
_didDragPastReleaseThreshold = false;
HideCarousel(true);
}
示例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;
}
}
示例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");
}
示例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();
}