Exemple #1
0
	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);
		}
	}
	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;
	}
Exemple #3
0
	/// <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);
	}
Exemple #4
0
	public void SetContent(HUDPrefab content, int windowId)
	{
		this.Content = content;
		this.WindowId = windowId;
		content.ApplyHUDChanges(transform, windowAlpha);
	}