/// <summary> /// /// </summary> /// <param name="hud"></param> public void RemoveHud(bl_HudInfo hud) { if (Huds.Contains(hud)) { Huds.Remove(hud); } else { Debug.Log("Huds list dont contain this hud!"); } }
/// <summary> /// /// </summary> /// <param name="i">Id of hud in list</param> public void HideStateHud(bl_HudInfo hud, bool hide = false) { if (Huds.Contains(hud)) { for (int i = 0; i < Huds.Count; i++) { if (Huds[i] == hud) { Huds[i].Hide = hide; } } } }
private void Palpating(bl_HudInfo hud) { if (hud.m_Color.a <= 0) { hud.tip = false; } else if (hud.m_Color.a >= 1) { hud.tip = true; } //Create a loop if (hud.tip == false) { hud.m_Color.a += Time.deltaTime * 0.5f; } else { hud.m_Color.a -= Time.deltaTime * 0.5f; } }
private bl_HudInfo GetHudInfo(Transform target) { bl_HudInfo newHudInfo = new bl_HudInfo(); QuestManager qm = GameManager.Get <QuestManager>(); newHudInfo.m_Target = target; newHudInfo.m_Color = qm.defaultHudInfo.m_Color; newHudInfo.m_Icon = qm.defaultHudInfo.m_Icon; newHudInfo.m_MaxSize = qm.defaultHudInfo.m_MaxSize; newHudInfo.m_Text = qm.defaultHudInfo.m_Text; newHudInfo.m_TypeHud = qm.defaultHudInfo.m_TypeHud; newHudInfo.Offset = qm.defaultHudInfo.Offset; newHudInfo.ShowDistance = qm.defaultHudInfo.ShowDistance; newHudInfo.ShowDynamically = qm.defaultHudInfo.ShowDynamically; newHudInfo.tip = qm.defaultHudInfo.tip; newHudInfo.Arrow = qm.defaultHudInfo.Arrow; newHudInfo.Hide = qm.defaultHudInfo.Hide; newHudInfo.HideOnCloseDistance = qm.defaultHudInfo.HideOnCloseDistance; newHudInfo.HideOnLargeDistance = qm.defaultHudInfo.HideOnLargeDistance; return(newHudInfo); }
public void Initialize() { QuestManager qm = GameManager.Get <QuestManager>(); if (objectiveText != "") { qm.DisplayPermanentObjective(objectiveText); } qm.DisplayDialogue(displayTexts, this, speaker == Speaker.Human); foreach (GameObject target in waypointTargets) { if (target != null) { bl_HudInfo info = GetHudInfo(target.transform); spawnedHudInfos.Add(info); CachedHudManager.CreateHud(info); } } if (soundControls.interactEffects.Length > 0) { SoundManager sm = GameManager.Get <SoundManager>(); switch (soundControls.soundPlayType) { case SoundControls.PlayType.PlayAll: foreach (AudioClip ac in soundControls.interactEffects) { sm.Play(ac); } break; case SoundControls.PlayType.PlayRandom: int clipIndex = Mathf.RoundToInt(Random.Range(0, soundControls.interactEffects.Length)); sm.Play(soundControls.interactEffects[clipIndex]); break; } } }
//Add a new Huds from instance to the list public void CreateHud(bl_HudInfo info) { Huds.Add(info); }
private bl_HudInfo GetHudInfo(Transform target) { bl_HudInfo newHudInfo = new bl_HudInfo(); QuestManager qm = GameManager.Get<QuestManager>(); newHudInfo.m_Target = target; newHudInfo.m_Color = qm.defaultHudInfo.m_Color; newHudInfo.m_Icon = qm.defaultHudInfo.m_Icon; newHudInfo.m_MaxSize = qm.defaultHudInfo.m_MaxSize; newHudInfo.m_Text = qm.defaultHudInfo.m_Text; newHudInfo.m_TypeHud = qm.defaultHudInfo.m_TypeHud; newHudInfo.Offset = qm.defaultHudInfo.Offset; newHudInfo.ShowDistance = qm.defaultHudInfo.ShowDistance; newHudInfo.ShowDynamically = qm.defaultHudInfo.ShowDynamically; newHudInfo.tip = qm.defaultHudInfo.tip; newHudInfo.Arrow = qm.defaultHudInfo.Arrow; newHudInfo.Hide = qm.defaultHudInfo.Hide; newHudInfo.HideOnCloseDistance = qm.defaultHudInfo.HideOnCloseDistance; newHudInfo.HideOnLargeDistance = qm.defaultHudInfo.HideOnLargeDistance; return newHudInfo; }