Пример #1
0
 /// <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;
 }