public void RemoveRevealer(MangoFogRevealer rev) { if (revealerRegister.ContainsKey(rev.GetUniqueID())) { revealerRegister.Remove(rev.GetUniqueID()); DoRemoveRevealer(rev); } }
public void AddRevealer(MangoFogRevealer rev) { if (!revealerRegister.ContainsKey(rev.GetUniqueID())) { revealerRegister[rev.GetUniqueID()] = rev; DoAddRevealer(rev); } }
/// <summary> /// Creates a new fog revealer and adds it to the instance list /// </summary> protected virtual void Init() { revealer = new MangoFogRevealer(); revealer.SetUnit(this); revealer.SetRevealerType(revealerType); revealer.SetPosition(transform.position); revealer.SetRadius(viewRadius); revealer.SetUniqueID(gameObject.GetInstanceID()); revealer.SetFOVDegrees(fovDegrees); revealer.SetLOSInnerRadius(LOSInnerRadius); revealer.SetLOSOuterRadius(LOSOuterRadius); revealer.SetReverseLOSDirection(reverseLOSDirection); revealer.SetBounds(new Bounds(transform.position, new Vector3((viewRadius * 2) * boundsSizeMultiplier, (viewRadius * 2) * boundsSizeMultiplier, (viewRadius * 2) * boundsSizeMultiplier))); MangoFogInstance.Instance.AddRevealer(revealer); isActive = true; }