private void SetHintArrowByScreenPos(MonoHintArrow arrow, BaseMonoEntity entity) { bool flag = (((entity != null) && entity.IsActive()) && !Singleton <AvatarManager> .Instance.IsLocalAvatar(entity.GetRuntimeID())) && !Singleton <CameraManager> .Instance.GetMainCamera().IsEntityVisible(entity); bool isArrowVisibleBefore = (arrow.state == MonoHintArrow.State.Visible) || (arrow.state == MonoHintArrow.State.FadingIn); bool flag3 = (entity == null) || entity.IsToBeRemove(); if ((arrow.state == MonoHintArrow.State.Hidden) && flag3) { UnityEngine.Object.Destroy(arrow.gameObject); } else if (isArrowVisibleBefore && !flag) { arrow.SetVisible(false); if (flag3) { arrow.SetDestroyUponFadeOut(); } } else if (!isArrowVisibleBefore && flag) { arrow.SetVisible(true); } if (flag) { this.UpdateHintArrow(arrow.transform, entity.XZPosition, isArrowVisibleBefore); } }
public void AddHintArrow(uint listenRuntimeID) { BaseMonoEntity listenEntity = Singleton <EventManager> .Instance.GetEntity(listenRuntimeID); string path = string.Empty; if (Singleton <RuntimeIDManager> .Instance.ParseCategory(listenRuntimeID) == 4) { path = "UI/HintArrowAlt/HintArrowMonsterAlt"; } else if (Singleton <RuntimeIDManager> .Instance.ParseCategory(listenRuntimeID) == 3) { path = "UI/HintArrowAlt/HintArrowAvatarAlt"; } else { if (!(listenEntity is BaseMonoDynamicObject) || (Singleton <EventManager> .Instance.GetActor(listenEntity.GetRuntimeID()) == null)) { throw new Exception("Invalid Type or State!"); } path = "UI/HintArrowAlt/HintArrowExitAlt"; } MonoHintArrow component = UnityEngine.Object.Instantiate <GameObject>(Miscs.LoadResource <GameObject>(path, BundleType.RESOURCE_FILE)).GetComponent <MonoHintArrow>(); component.Init(listenRuntimeID, listenEntity); component.transform.SetParent(this._hintRing.transform, false); this._hintArrowLs.Add(component); }
private void UpdateAllHintArrow() { this.SetHintRingPosition(); bool visible = false; for (int i = 0; i < this._hintArrowLs.Count; i++) { if (this._hintArrowLs[i] != null) { MonoHintArrow arrow = this._hintArrowLs[i]; this.SetHintArrowByScreenPos(arrow, arrow.listenEntity); if (arrow.state != MonoHintArrow.State.Hidden) { visible = true; } } } this.UpdateHintArrowForPath(); visible |= this._hintArrowForPath != null; if (visible != this._hintRingVisible) { this.SetHintRingVisible(visible); } if (!this._hintRingVisible && (this._hintRingOutAnimState.normalizedTime > 1f)) { this._hintRing.SetActive(false); } }
public void AddHintArrowForPath(MonoSpawnPoint spawn) { if (this._hintArrowForPath != null) { this.RemoveHintArrowForPath(); } string path = "UI/HintArrowAlt/HintArrowExitAlt"; MonoHintArrow component = UnityEngine.Object.Instantiate <GameObject>(Miscs.LoadResource <GameObject>(path, BundleType.RESOURCE_FILE)).GetComponent <MonoHintArrow>(); component.Init(0, null); component.transform.SetParent(this._hintRing.transform, false); this._pathSpawn = spawn; this._hintArrowForPath = component; this._hintArrowForPath.SetVisible(true); this.UpdateHintArrow(component.transform, spawn.XZPosition, false); }