Closed hdmmY closed 6 years ago
At DanmakU\DamakU Plugin\Runtime\Fireables\Shapes\Circle.cs
Method : Fire
float radius = Radius.GetValue (); int count = Mathf.RoundToInt (Count.GetValue ()); var rotation = state.Rotation.GetValue (); for (int i = 0; i < count; i++) { var angle = rotation + i * (Mathf.PI * 2 / count); state.Position = state.Position + (radius * RotationUtiliity.ToUnitVector (angle)); state.Rotation = rotation; Subfire (state); }
I think the right implemention is
float radius = Radius.GetValue (); int count = Mathf.RoundToInt (Count.GetValue ()); var rotation = state.Rotation.GetValue (); var origin = state.Position; for (int i = 0; i < count; i++) { var angle = rotation + i * (Mathf.PI * 2 / count); state.Position = origin + (radius * RotationUtiliity.ToUnitVector (angle)); state.Rotation = rotation; Subfire (state); }
Since the state.Position will be change during the "for" loop.
At DanmakU\DamakU Plugin\Runtime\Fireables\Shapes\Circle.cs
Method : Fire
I think the right implemention is
Since the state.Position will be change during the "for" loop.