This repository was archived by the owner on Nov 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved HUD Name label to top and removed display of main name when pic…
…ked up
- Loading branch information
1 parent
8307b7b
commit 0eb7419
Showing
8 changed files
with
142 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,64 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using vapitypes; | ||
|
||
public class ShowInfo : MonoBehaviour, HUD.IHudVisible { | ||
public string name; | ||
public string type; | ||
public List<HUD.Resource> resources; | ||
public List<HUD.Statistic> statistics; | ||
public Dictionary<string, string> tags; | ||
public HUD.ColorFamily colorFamily; | ||
|
||
private UnityEngine.UI.Text[] VMDetails; | ||
private HUD HUD; | ||
private UI UI; | ||
|
||
// Use this for initialization | ||
|
||
void Start () { | ||
VMDetails = this.GetComponentsInChildren<UnityEngine.UI.Text>(); | ||
VMDetails[1].enabled = false; | ||
|
||
HUD = GameObject.Find("HUD").GetComponent<HUD> (); | ||
UI = GameObject.Find("GUI").GetComponent<UI> (); | ||
} | ||
|
||
// Update is called once per frameo = | ||
void Update () { | ||
|
||
} | ||
|
||
public void OnTriggerEnter() | ||
{ | ||
VMDetails = this.GetComponentsInChildren<UnityEngine.UI.Text>(); | ||
VMDetails[1].enabled = true; | ||
|
||
UI.transform.position = transform.position; | ||
UI.transform.SetParent(transform); | ||
HUD.updateHud(this); | ||
} | ||
|
||
|
||
public void OnTriggerExit() | ||
{ | ||
VMDetails = this.GetComponentsInChildren<UnityEngine.UI.Text>(); | ||
VMDetails[1].enabled = false; | ||
|
||
HUD.updateHud(null); | ||
} | ||
|
||
// IHudVisible implementation | ||
public string Name { get { return name; } } | ||
public string Type { get { return type; } } | ||
public HUD.ColorFamily ColorFamily { get { return colorFamily; } } | ||
public List<HUD.Statistic> Statistics { get { return statistics; } } | ||
public List<HUD.Resource> Resources { get { return resources; } } | ||
public Dictionary<string, string> Tags { get { return tags; } } | ||
} | ||
|
||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using vapitypes; | ||
|
||
public class ShowInfo : MonoBehaviour, HUD.IHudVisible { | ||
public string name; | ||
public string type; | ||
public List<HUD.Resource> resources; | ||
public List<HUD.Statistic> statistics; | ||
public Dictionary<string, string> tags; | ||
public HUD.ColorFamily colorFamily; | ||
|
||
private UnityEngine.UI.Text[] VMDetails; | ||
private HUD HUD; | ||
private UI UI; | ||
|
||
// Use this for initialization | ||
|
||
void Start () { | ||
VMDetails = this.GetComponentsInChildren<UnityEngine.UI.Text>(); | ||
VMDetails[1].enabled = false; | ||
|
||
HUD = GameObject.Find("HUD").GetComponent<HUD> (); | ||
UI = GameObject.Find("GUI").GetComponent<UI> (); | ||
|
||
} | ||
|
||
// Update is called once per frameo = | ||
void Update () { | ||
|
||
} | ||
|
||
public void OnTriggerEnter() | ||
{ | ||
VMDetails = this.GetComponentsInChildren<UnityEngine.UI.Text>(); | ||
VMDetails[0].enabled = false; | ||
VMDetails[1].enabled = true; | ||
|
||
UI.transform.position = transform.position; | ||
UI.transform.SetParent(transform); | ||
HUD.updateHud(this); | ||
} | ||
|
||
|
||
public void OnTriggerExit() | ||
{ | ||
VMDetails = this.GetComponentsInChildren<UnityEngine.UI.Text>(); | ||
VMDetails[0].enabled = true; | ||
VMDetails[1].enabled = false; | ||
|
||
HUD.updateHud(null); | ||
|
||
} | ||
|
||
// IHudVisible implementation | ||
public string Name { get { return name; } } | ||
public string Type { get { return type; } } | ||
public HUD.ColorFamily ColorFamily { get { return colorFamily; } } | ||
public List<HUD.Statistic> Statistics { get { return statistics; } } | ||
public List<HUD.Resource> Resources { get { return resources; } } | ||
public Dictionary<string, string> Tags { get { return tags; } } | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.