public void DrawShape(Color color) { if (!SystemConfig.IsOpenEffectDrawLine) { return; } if (this.fixBasePoint == null) { return; } GraghShape graghShape = this.graghShape; if (graghShape != GraghShape.Sector) { if (graghShape == GraghShape.Rect) { this.DrawRect(color); } } else if (this.IsCircle) { this.DrawCircle(color); } else { this.DrawSector(color); } }
public GraghMessage(XPoint theFixBasePoint, GraghShape theGraghShape, float theRange, float theAngle, float theWidth, float theHeight) { this.fixBasePoint = theFixBasePoint; this.graghShape = theGraghShape; this.range = theRange; this.angle = theAngle; this.width = theWidth; this.height = theHeight; this.forward = Quaternion.Euler(this.fixBasePoint.rotation.get_eulerAngles().x, this.fixBasePoint.rotation.get_eulerAngles().y, this.fixBasePoint.rotation.get_eulerAngles().z) * Vector3.get_forward(); }
public bool InArea(Vector3 position, float hitRange = 0f) { if (this.fixBasePoint == null) { return(false); } GraghShape graghShape = this.graghShape; if (graghShape != GraghShape.Sector) { return(graghShape == GraghShape.Rect && this.InRectArea(position, hitRange)); } if (this.IsCircle) { return(this.InCircleArea(position, hitRange)); } return(this.InSectorArea(position, hitRange)); }
protected List <Vector3> GetAccuratePointByWarningMessage(WarningMessage message) { List <Vector3> list = new List <Vector3>(); GraghShape graghShape = message.graghShape; if (graghShape != GraghShape.Sector) { if (graghShape == GraghShape.Rect) { list.AddRange(this.GetAccuratePointByRectangle(this.ownerActor.FixTransform.get_position(), message.fixBasePoint, message.width, message.height, XUtility.GetHitRadius(this.ownerActor.FixTransform), message.casterRadius)); } } else if (message.IsCircle) { list.AddRange(this.GetAccuratePointByCircle(this.ownerActor.FixTransform.get_position(), message.fixBasePoint, message.range, XUtility.GetHitRadius(this.ownerActor.FixTransform), message.casterRadius)); } else { list.AddRange(this.GetAccuratePointBySector(this.ownerActor.FixTransform.get_position(), message.fixBasePoint, message.range, message.angle, XUtility.GetHitRadius(this.ownerActor.FixTransform), message.casterRadius)); } return(list); }
public WarningMessage(XPoint theFixBasePoint, GraghShape theAreaShape, float theRange, float theAngle, float theWidth, float theHeight, float theCasterRadius) : base(theFixBasePoint, theAreaShape, theRange, theAngle, theWidth, theHeight) { this.casterRadius = theCasterRadius; }