Class Shape
Inheritance
System.Object
Shape
Implements
System.Collections.IEnumerable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: BulletStorm.dll
Syntax
[Serializable]
public class Shape : IReadOnlyList<BulletEmitParam>, IReadOnlyCollection<BulletEmitParam>, IEnumerable<BulletEmitParam>, IEnumerable
Constructors
|
Improve this Doc
View Source
Shape(Shape)
Declaration
public Shape(Shape shape)
Parameters
| Type |
Name |
Description |
| Shape |
shape |
The original shape
|
|
Improve this Doc
View Source
Shape(Int32)
Declaration
Parameters
| Type |
Name |
Description |
| System.Int32 |
num |
Number of bullets in the shape.
|
Properties
|
Improve this Doc
View Source
Count
Total bullets count in the shape.
Declaration
public int Count { get; }
Property Value
| Type |
Description |
| System.Int32 |
|
|
Improve this Doc
View Source
Item[Int32]
Declaration
public BulletEmitParam this[int index] { get; }
Parameters
| Type |
Name |
Description |
| System.Int32 |
index |
|
Property Value
Methods
|
Improve this Doc
View Source
AddSpeed(Single)
Add speed to all bullets, direction is the bullet target relative to origin.
Declaration
public Shape AddSpeed(float speed)
Parameters
| Type |
Name |
Description |
| System.Single |
speed |
Speed increment.
|
Returns
|
Improve this Doc
View Source
AddSpeedByIndex(AnimationCurve, Single)
Add speed to bullets by their indexes, direction is the bullet target relative to origin.
Declaration
public Shape AddSpeedByIndex(AnimationCurve curve, float multiplier)
Parameters
| Type |
Name |
Description |
| UnityEngine.AnimationCurve |
curve |
X-axis 0~1 represents all indexes, y-axis is speed.
|
| System.Single |
multiplier |
Multiplier for curve y-axis.
|
Returns
|
Improve this Doc
View Source
AddSpeedTowards(Single, Vector3)
Add speed to all bullets, direction is from bullet target to target target.
Declaration
public Shape AddSpeedTowards(float speed, Vector3 target)
Parameters
| Type |
Name |
Description |
| System.Single |
speed |
Speed increment.
|
| UnityEngine.Vector3 |
target |
Target position.
|
Returns
|
Improve this Doc
View Source
AddVelocity(Vector3)
Add velocity to all bullets.
Declaration
public Shape AddVelocity(Vector3 velocity)
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector3 |
velocity |
Velocity increment.
|
Returns
|
Improve this Doc
View Source
Arc(Int32, Single, Single)
An arc on z-x plane, from left to right, middle point on positive z-axis.
Declaration
public static Shape Arc(int num, float angle, float radius)
Parameters
| Type |
Name |
Description |
| System.Int32 |
num |
Number of bullets
|
| System.Single |
angle |
From to angle of the arc in degree
|
| System.Single |
radius |
Radius of the arc
|
Returns
|
Improve this Doc
View Source
FibonacciSphere(Int32, Single)
Use Fibonacci sphere algorithm to generate an roughly equal-distance point sphere.
Declaration
public static Shape FibonacciSphere(int num, float radius)
Parameters
| Type |
Name |
Description |
| System.Int32 |
num |
Number of bullets
|
| System.Single |
radius |
Radius of the sphere
|
Returns
|
Improve this Doc
View Source
GetEnumerator()
Declaration
public IEnumerator<BulletEmitParam> GetEnumerator()
Returns
|
Improve this Doc
View Source
Line(Int32, Single)
A line on x-axis, from left to right, origin is the middle point.
Declaration
public static Shape Line(int num, float length)
Parameters
| Type |
Name |
Description |
| System.Int32 |
num |
Number of bullets
|
| System.Single |
length |
Length of the line
|
Returns
|
Improve this Doc
View Source
Move(Vector3)
Declaration
public Shape Move(Vector3 offset)
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector3 |
offset |
|
Returns
|
Improve this Doc
View Source
RandomSphere(Int32, Single)
Use random value to generate a sphere.
Declaration
public static Shape RandomSphere(int num, float radius)
Parameters
| Type |
Name |
Description |
| System.Int32 |
num |
Number of bullets
|
| System.Single |
radius |
Radius of the sphere
|
Returns
|
Improve this Doc
View Source
Ring(Int32, Single)
A ring on the z-x plane, positive z-axis is the first bullet, and rotates to positive x-axis.
Declaration
public static Shape Ring(int num, float radius)
Parameters
| Type |
Name |
Description |
| System.Int32 |
num |
Number of bullets
|
| System.Single |
radius |
Radius of the ring
|
Returns
|
Improve this Doc
View Source
Rotate(Single, Single, Single)
Declaration
public Shape Rotate(float xAngle, float yAngle, float zAngle)
Parameters
| Type |
Name |
Description |
| System.Single |
xAngle |
|
| System.Single |
yAngle |
|
| System.Single |
zAngle |
|
Returns
|
Improve this Doc
View Source
Rotate(Single, Vector3)
Declaration
public Shape Rotate(float angle, Vector3 axis)
Parameters
| Type |
Name |
Description |
| System.Single |
angle |
|
| UnityEngine.Vector3 |
axis |
|
Returns
|
Improve this Doc
View Source
Rotate(Quaternion)
Declaration
public Shape Rotate(Quaternion rotation)
Parameters
| Type |
Name |
Description |
| UnityEngine.Quaternion |
rotation |
|
Returns
|
Improve this Doc
View Source
Rotate(Vector3)
Declaration
public Shape Rotate(Vector3 euler)
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector3 |
euler |
|
Returns
|
Improve this Doc
View Source
RotateAround(Vector3, Single, Vector3)
Declaration
public Shape RotateAround(Vector3 point, float angle, Vector3 axis)
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector3 |
point |
|
| System.Single |
angle |
|
| UnityEngine.Vector3 |
axis |
|
Returns
|
Improve this Doc
View Source
RotateAround(Vector3, Quaternion)
Rotates the whole shape around a point.
Declaration
public Shape RotateAround(Vector3 point, Quaternion rotation)
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector3 |
point |
Center point of the rotation
|
| UnityEngine.Quaternion |
rotation |
|
Returns
|
Improve this Doc
View Source
SetColor(Color)
Set color for all bullets.
Declaration
public Shape SetColor(Color color)
Parameters
| Type |
Name |
Description |
| UnityEngine.Color |
color |
|
Returns
|
Improve this Doc
View Source
SetColorByIndex(Gradient)
Set bullet color according to bullet index.
Declaration
public Shape SetColorByIndex(Gradient gradient)
Parameters
| Type |
Name |
Description |
| UnityEngine.Gradient |
gradient |
Color gradient.
|
Returns
|
Improve this Doc
View Source
SetSize(Single)
Set size for all bullets.
Declaration
public Shape SetSize(float size)
Parameters
| Type |
Name |
Description |
| System.Single |
size |
Bullet size.
|
Returns
|
Improve this Doc
View Source
SetSize(Single, Single, Single)
Set size for all bullets.
Declaration
public Shape SetSize(float x, float y, float z)
Parameters
| Type |
Name |
Description |
| System.Single |
x |
X scale.
|
| System.Single |
y |
Y scale.
|
| System.Single |
z |
z scale.
|
Returns
|
Improve this Doc
View Source
SetSize(Vector3)
Set size for all bullets.
Declaration
public Shape SetSize(Vector3 size)
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector3 |
size |
Bullet size.
|
Returns
|
Improve this Doc
View Source
Sort(ParamComparer)
Sorts bullets in the shape.
Declaration
public Shape Sort(ParamComparer comparer)
Parameters
Returns
Operators
|
Improve this Doc
View Source
Addition(Shape, Shape)
Adds two shapes together.
Declaration
public static Shape operator +(Shape first, Shape second)
Parameters
Returns
Explicit Interface Implementations
|
Improve this Doc
View Source
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
| Type |
Description |
| System.Collections.IEnumerator |
|
Implements
System.Collections.Generic.IReadOnlyList<T>
System.Collections.Generic.IReadOnlyCollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable