public void UpdateKeywordHelp(Entity entity, Actor actor, bool showOnRight, float?overrideScale = new float?()) { float x = 1f; if (overrideScale.HasValue) { x = overrideScale.Value; } this.PrepareToUpdateKeywordHelp(actor); string[] strArray = GameState.Get().GetGameEntity().NotifyOfKeywordHelpPanelDisplay(entity); if (strArray != null) { this.SetupKeywordPanel(strArray[0], strArray[1]); } this.SetUpPanels(entity); TutorialKeywordTooltip tooltip = null; float num2 = 0f; float num3 = 0f; for (int i = 0; i < this.m_keywordPanels.Count; i++) { TutorialKeywordTooltip tooltip2 = this.m_keywordPanels[i]; num2 = 1.05f; if (entity.IsHero()) { num2 = 1.2f; } else if (entity.GetZone() == TAG_ZONE.PLAY) { if (UniversalInputManager.UsePhoneUI != null) { x = 1.7f; } num2 = 1.45f * x; } tooltip2.transform.localScale = new Vector3(x, x, x); num3 = -0.2f * this.m_actor.GetMeshRenderer().bounds.size.z; if ((UniversalInputManager.UsePhoneUI != null) && (entity.GetZone() == TAG_ZONE.PLAY)) { num3 += 1.5f; } if (i == 0) { if (showOnRight) { tooltip2.transform.position = this.m_actor.transform.position + new Vector3(this.m_actor.GetMeshRenderer().bounds.size.x *num2, 0f, this.m_actor.GetMeshRenderer().bounds.extents.z + num3); } else { tooltip2.transform.position = this.m_actor.transform.position + new Vector3(-this.m_actor.GetMeshRenderer().bounds.size.x *num2, 0f, this.m_actor.GetMeshRenderer().bounds.extents.z + num3); } } else { tooltip2.transform.position = tooltip.transform.position - new Vector3(0f, 0f, (tooltip.GetHeight() * 0.35f) + (tooltip2.GetHeight() * 0.35f)); } tooltip = tooltip2; } GameState.Get().GetGameEntity().NotifyOfHelpPanelDisplay(this.m_keywordPanels.Count); }
public void SetupKeywordPanel(string headline, string description) { TutorialKeywordTooltip component = UnityEngine.Object.Instantiate <GameObject>(this.m_keywordPanelPrefab.gameObject).GetComponent <TutorialKeywordTooltip>(); if (component != null) { component.Initialize(headline, description); this.m_keywordPanels.Add(component); } }