private static HUDIndicator InstantiateIndicator(ref Target target, HUDIndicator prefab, PlacementSpace space, Vector3 position, float rotation) { UIAnchor anchor = target.anchor; Quaternion quaternion = Quaternion.AngleAxis(rotation, Vector3.back); switch (space) { case PlacementSpace.World: { Vector3?nullable = CameraFX.World2Screen(position); position = Target.camera.ScreenToWorldPoint(!nullable.HasValue ? Vector3.zero : nullable.Value); break; } case PlacementSpace.Screen: position = Target.camera.ScreenToWorldPoint(position); break; case PlacementSpace.Viewport: position = Target.camera.ViewportToWorldPoint(position); break; case PlacementSpace.Anchor: position = anchor.transform.TransformPoint(position); quaternion = anchor.transform.rotation * quaternion; break; } position.z = anchor.transform.position.z; HUDIndicator indicator = (HUDIndicator)Object.Instantiate(prefab, position, quaternion); indicator.transform.parent = anchor.transform; indicator.transform.localScale = Vector3.one; indicator.anchor = target.anchor; return(indicator); }
public static void CreateIndicator(Vector3 worldPoint, bool followPoint, HUDHitIndicator prefab) { HUDHitIndicator indicator = (HUDHitIndicator)HUDIndicator.InstantiateIndicator(HUDIndicator.ScratchTarget.CenteredAuto, prefab, HUDIndicator.PlacementSpace.World, worldPoint); indicator.worldPosition = worldPoint; indicator.followPoint = followPoint; }
public static void Add(HUDIndicator hud) { if (hud.listIndex == -1) { hud.listIndex = activeIndicators.Count; activeIndicators.Add(hud); } }
private void Start() { narrationObject.gameObject.SetActive(false); m_guidanceArrow = Instantiate(guidanceArrowPrefab) as GuidanceArrow; m_guidanceArrow.gameObject.SetActive(false); m_hudIndicator = Instantiate(hudIndicatorPrefab) as HUDIndicator; m_hudIndicator.gameObject.SetActive(false); }
public static void Add(HUDIndicator hud) { if (hud.listIndex != -1) { return; } hud.listIndex = HUDIndicator.INDICATOR.activeIndicators.Count; HUDIndicator.INDICATOR.activeIndicators.Add(hud); }
internal static void Step() { HUDIndicator._stepTime = HUDIndicator.time; Camera camera = Camera.main; if (camera) { HUDIndicator.worldToCameraLocalMatrix = Matrix4x4.Scale(new Vector3(1f, 1f, -1f)) * camera.worldToCameraMatrix; } int count = HUDIndicator.INDICATOR.activeIndicators.Count; int num = count - 1; while (num >= 0) { if (HUDIndicator.INDICATOR.activeIndicators[num].Continue()) { num--; } else { int num1 = num; do { HUDIndicator item = HUDIndicator.INDICATOR.activeIndicators[num]; HUDIndicator.INDICATOR.activeIndicators.RemoveAt(num); item.listIndex = -1; UnityEngine.Object.Destroy(item.gameObject); count--; int num2 = num - 1; num = num2; if (num2 < 0) { continue; } while (HUDIndicator.INDICATOR.activeIndicators[num].Continue()) { int num3 = num - 1; num = num3; if (num3 < 0) { goto Label0; } } num1 = num; Label0: }while (num1 == num); while (num1 < count) { HUDIndicator.INDICATOR.activeIndicators[num1].listIndex = num1; num1++; } break; } } }
protected static HUDIndicator InstantiateIndicator(HUDIndicator.ScratchTarget target, HUDIndicator prefab, HUDIndicator.PlacementSpace space, Vector3 position, float rotation) { HUDIndicator.ScratchTarget scratchTarget = target; if (scratchTarget == HUDIndicator.ScratchTarget.CenteredAuto) { return(HUDIndicator.InstantiateIndicator(ref HUDIndicator.CenterAuto, prefab, space, position, rotation)); } if (scratchTarget != HUDIndicator.ScratchTarget.CenteredFixed3000Tall) { throw new ArgumentOutOfRangeException("target"); } return(HUDIndicator.InstantiateIndicator(ref HUDIndicator.CenterFixed3000Tall, prefab, space, position, rotation)); }
public static void CreateIndicator(Vector3 worldDamageDirection, double damageAmount, double timestamp, double duration, HUDDirectionalDamage prefab) { HUDDirectionalDamage damage = (HUDDirectionalDamage)HUDIndicator.InstantiateIndicator(HUDIndicator.ScratchTarget.CenteredFixed3000Tall, prefab, HUDIndicator.PlacementSpace.DoNotModify, Vector3.zero); damage.damageTime = timestamp; damage.duration = duration; damage.damageAmount = damageAmount; damage.worldDirection = -worldDamageDirection; damage.transform.localPosition = Vector3.zero; damage.transform.localRotation = Quaternion.identity; damage.transform.localScale = Vector3.one; damage.texture.ForceReloadMaterial(); }
internal static void Step() { _stepTime = time; Camera main = Camera.main; if (main != null) { worldToCameraLocalMatrix = Matrix4x4.Scale(new Vector3(1f, 1f, -1f)) * main.worldToCameraMatrix; } int count = INDICATOR.activeIndicators.Count; for (int i = count - 1; i >= 0; i--) { if (INDICATOR.activeIndicators[i].Continue()) { continue; } int num3 = i; do { HUDIndicator indicator = INDICATOR.activeIndicators[i]; INDICATOR.activeIndicators.RemoveAt(i); indicator.listIndex = -1; Object.Destroy(indicator.gameObject); count--; if (--i >= 0) { do { if (!INDICATOR.activeIndicators[i].Continue()) { num3 = i; break; } }while (--i >= 0); } }while (num3 == i); while (num3 < count) { INDICATOR.activeIndicators[num3].listIndex = num3; num3++; } break; } }
private static HUDIndicator InstantiateIndicator(ref HUDIndicator.Target target, HUDIndicator prefab, HUDIndicator.PlacementSpace space, Vector3 position, float rotation) { UIAnchor uIAnchor = target.anchor; Quaternion quaternion = Quaternion.AngleAxis(rotation, Vector3.back); switch (space) { case HUDIndicator.PlacementSpace.World: { Camera camera = HUDIndicator.Target.camera; Vector3?nullable = CameraFX.World2Screen(position); position = camera.ScreenToWorldPoint((!nullable.HasValue ? Vector3.zero : nullable.Value)); break; } case HUDIndicator.PlacementSpace.Screen: { position = HUDIndicator.Target.camera.ScreenToWorldPoint(position); break; } case HUDIndicator.PlacementSpace.Viewport: { position = HUDIndicator.Target.camera.ViewportToWorldPoint(position); break; } case HUDIndicator.PlacementSpace.Anchor: { position = uIAnchor.transform.TransformPoint(position); quaternion = uIAnchor.transform.rotation * quaternion; break; } } position.z = uIAnchor.transform.position.z; HUDIndicator hUDIndicator = (HUDIndicator)UnityEngine.Object.Instantiate(prefab, position, quaternion); hUDIndicator.transform.parent = uIAnchor.transform; hUDIndicator.transform.localScale = Vector3.one; hUDIndicator.anchor = target.anchor; return(hUDIndicator); }
public static void Remove(HUDIndicator hud) { if (hud.listIndex != -1) { try { activeIndicators.RemoveAt(hud.listIndex); int listIndex = hud.listIndex; int count = activeIndicators.Count; while (listIndex < count) { activeIndicators[listIndex].listIndex = listIndex; listIndex++; } } finally { hud.listIndex = -1; } } }
public static void Remove(HUDIndicator hud) { if (hud.listIndex == -1) { return; } try { HUDIndicator.INDICATOR.activeIndicators.RemoveAt(hud.listIndex); int num = hud.listIndex; int count = HUDIndicator.INDICATOR.activeIndicators.Count; while (num < count) { HUDIndicator.INDICATOR.activeIndicators[num].listIndex = num; num++; } } finally { hud.listIndex = -1; } }
protected static HUDIndicator InstantiateIndicator(HUDIndicator.ScratchTarget target, HUDIndicator prefab) { return(HUDIndicator.InstantiateIndicator(target, prefab, HUDIndicator.PlacementSpace.Anchor, Vector3.zero, 0f)); }
protected static HUDIndicator InstantiateIndicator(HUDIndicator.ScratchTarget target, HUDIndicator prefab, HUDIndicator.PlacementSpace space, Vector3 position) { return(HUDIndicator.InstantiateIndicator(target, prefab, space, position, 0f)); }
protected static HUDIndicator InstantiateIndicator(HUDIndicator.ScratchTarget target, HUDIndicator prefab) { return HUDIndicator.InstantiateIndicator(target, prefab, HUDIndicator.PlacementSpace.Anchor, Vector3.zero, 0f); }
public static void Remove(HUDIndicator hud) { if (hud.listIndex == -1) { return; } try { HUDIndicator.INDICATOR.activeIndicators.RemoveAt(hud.listIndex); int num = hud.listIndex; int count = HUDIndicator.INDICATOR.activeIndicators.Count; while (num < count) { HUDIndicator.INDICATOR.activeIndicators[num].listIndex = num; num++; } } finally { hud.listIndex = -1; } }
public static void Add(HUDIndicator hud) { if (hud.listIndex != -1) { return; } hud.listIndex = HUDIndicator.INDICATOR.activeIndicators.Count; HUDIndicator.INDICATOR.activeIndicators.Add(hud); }
private static HUDIndicator InstantiateIndicator(ref HUDIndicator.Target target, HUDIndicator prefab, HUDIndicator.PlacementSpace space, Vector3 position, float rotation) { UIAnchor uIAnchor = target.anchor; Quaternion quaternion = Quaternion.AngleAxis(rotation, Vector3.back); switch (space) { case HUDIndicator.PlacementSpace.World: { Camera camera = HUDIndicator.Target.camera; Vector3? nullable = CameraFX.World2Screen(position); position = camera.ScreenToWorldPoint((!nullable.HasValue ? Vector3.zero : nullable.Value)); break; } case HUDIndicator.PlacementSpace.Screen: { position = HUDIndicator.Target.camera.ScreenToWorldPoint(position); break; } case HUDIndicator.PlacementSpace.Viewport: { position = HUDIndicator.Target.camera.ViewportToWorldPoint(position); break; } case HUDIndicator.PlacementSpace.Anchor: { position = uIAnchor.transform.TransformPoint(position); quaternion = uIAnchor.transform.rotation * quaternion; break; } } position.z = uIAnchor.transform.position.z; HUDIndicator hUDIndicator = (HUDIndicator)UnityEngine.Object.Instantiate(prefab, position, quaternion); hUDIndicator.transform.parent = uIAnchor.transform; hUDIndicator.transform.localScale = Vector3.one; hUDIndicator.anchor = target.anchor; return hUDIndicator; }
protected Vector3 GetPoint(HUDIndicator.PlacementSpace space, Vector3 input) { switch (space) { case HUDIndicator.PlacementSpace.World: { Camera camera = HUDIndicator.Target.camera; Vector3? nullable = CameraFX.World2Screen(input); input = camera.ScreenToWorldPoint((!nullable.HasValue ? Vector3.zero : nullable.Value)); break; } case HUDIndicator.PlacementSpace.Screen: { input = HUDIndicator.Target.camera.ScreenToWorldPoint(input); break; } case HUDIndicator.PlacementSpace.Viewport: { input = HUDIndicator.Target.camera.ViewportToWorldPoint(input); break; } case HUDIndicator.PlacementSpace.Anchor: { input = this.anchor.transform.TransformPoint(input); break; } } return input; }
protected static HUDIndicator InstantiateIndicator(HUDIndicator.ScratchTarget target, HUDIndicator prefab, HUDIndicator.PlacementSpace space, Vector3 position, float rotation) { HUDIndicator.ScratchTarget scratchTarget = target; if (scratchTarget == HUDIndicator.ScratchTarget.CenteredAuto) { return HUDIndicator.InstantiateIndicator(ref HUDIndicator.CenterAuto, prefab, space, position, rotation); } if (scratchTarget != HUDIndicator.ScratchTarget.CenteredFixed3000Tall) { throw new ArgumentOutOfRangeException("target"); } return HUDIndicator.InstantiateIndicator(ref HUDIndicator.CenterFixed3000Tall, prefab, space, position, rotation); }
protected static HUDIndicator InstantiateIndicator(HUDIndicator.ScratchTarget target, HUDIndicator prefab, HUDIndicator.PlacementSpace space, Vector3 position) { return HUDIndicator.InstantiateIndicator(target, prefab, space, position, 0f); }