コード例 #1
0
ファイル: HUDContainer.cs プロジェクト: dallinnguyen/Pokemon
	public void Initialize(HUDPrefab content, ScreenSpace screenSpace, int windowId, Vector2 anchorMin, Vector2 anchorMax, float windowAlpha, HUD hud)
	{
		this.Content = content;
		this.screenSpace = screenSpace;
		this.WindowId = windowId;
		this.rectTransform.anchorMax = anchorMax;
		this.rectTransform.anchorMin = anchorMin;
		this.windowAlpha = windowAlpha;
		this.hud = hud;
		transform.SetParent(screenSpace.transform, false);
		if (content != null)
		{
			content.ApplyHUDChanges(transform, windowAlpha);
		}
	}
コード例 #2
0
	public void Initialize(HUDPrefab content, ScreenSpace screenSpace, int windowId, Vector2 anchorMin, Vector2 anchorMax, float windowAlpha, HUD hud, DockingPosition dockingPosition, OpenWindowCallback callback)
	{
		base.Initialize(content, screenSpace, windowId, anchorMin, anchorMax, windowAlpha, hud);
		this.dockingPosition = dockingPosition;
		this.callback = callback;
	}
コード例 #3
0
ファイル: ScreenSpace.cs プロジェクト: dallinnguyen/Pokemon
	/// <summary>
	/// Saves the currently opened HUD windows into the PlayerPrefs
	/// </summary>
	private void OnDestroy()
	{
		List<HUDContainer> c = new List<HUDContainer>(hudWindows);
		foreach (HUDContainer h in c)
		{
			if (h.Content == null)
			{
				hudWindows.Remove(h);
			}
		}

		HUDPrefab[] hud = new HUDPrefab[hudWindows.Count];

		for (int i = 0; i < hudWindows.Count; i++)
		{
			hud[i] = hudWindows[i].Content;
			hud[i].RectTransform.anchorMin = hudWindows[i].RectTransform.anchorMin;
			hud[i].RectTransform.anchorMax = hudWindows[i].RectTransform.anchorMax;
			hud[i].WindowID = i;
		}

		HUDController.Instance.ApplyHudChanges(hud, this.hud);
	}
コード例 #4
0
ファイル: HUDContainer.cs プロジェクト: dallinnguyen/Pokemon
	public void SetContent(HUDPrefab content, int windowId)
	{
		this.Content = content;
		this.WindowId = windowId;
		content.ApplyHUDChanges(transform, windowAlpha);
	}