Survivalcraft API 1.8.2.3
v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
ShapeshiftParticleSystem.cs
浏览该文件的文档.
1
using
Engine
;
2
using
Engine.Graphics
;
3
4
namespace
Game
{
5
public
class
ShapeshiftParticleSystem
:
ParticleSystem
<ShapeshiftParticleSystem.Particle> {
6
public
class
Particle
:
Game
.
Particle
{
7
public
float
Time
;
8
9
public
float
Duration
;
10
11
public
Vector3
Velocity
;
12
}
13
14
public
Random
m_random
=
new
();
15
16
public
float
m_generationSpeed
;
17
18
public
float
m_toGenerate
;
19
20
public
bool
Stopped
{
get
;
set
; }
21
22
public
Vector3
Position
{
get
;
set
; }
23
24
public
BoundingBox
BoundingBox
{
get
;
set
; }
25
26
public
ShapeshiftParticleSystem
() : base(40) {
27
Texture
=
ContentManager
.
Get
<
Texture2D
>(
"Textures/ShapeshiftParticle"
);
28
TextureSlotsCount
= 3;
29
}
30
31
public
override
bool
Simulate
(
float
dt) {
32
bool
flag =
false
;
33
m_generationSpeed
=
MathUtils
.
Min
(
m_generationSpeed
+ 15f * dt, 35f);
34
m_toGenerate
+=
m_generationSpeed
* dt;
35
for
(
int
i = 0; i <
Particles
.Length; i++) {
36
Particle
particle =
Particles
[i];
37
if
(particle.
IsActive
) {
38
flag =
true
;
39
particle.Time += dt;
40
if
(particle.
Time
<= particle.
Duration
) {
41
particle.Position += particle.Velocity * dt;
42
particle.FlipX =
m_random
.Bool();
43
particle.FlipY =
m_random
.Bool();
44
particle.TextureSlot = (int)
MathUtils
.
Min
(9.900001f * particle.
Time
/ particle.
Duration
, 8f);
45
}
46
else
{
47
particle.IsActive =
false
;
48
}
49
}
50
else
if
(!
Stopped
) {
51
while
(
m_toGenerate
>= 1f) {
52
particle.IsActive =
true
;
53
particle.Position.X =
m_random
.Float(
BoundingBox
.Min.X,
BoundingBox
.Max.X);
54
particle.Position.Y =
m_random
.Float(
BoundingBox
.Min.Y,
BoundingBox
.Max.Y);
55
particle.Position.Z =
m_random
.Float(
BoundingBox
.Min.Z,
BoundingBox
.Max.Z);
56
particle.Velocity =
new
Vector3
(0f,
m_random
.Float(0.5f, 1.5f), 0f);
57
particle.Color =
Color
.
White
;
58
particle.Size =
new
Vector2
(0.4f);
59
particle.Time = 0f;
60
particle.Duration =
m_random
.Float(0.75f, 1.5f);
61
m_toGenerate
-= 1f;
62
}
63
}
64
else
{
65
m_toGenerate
= 0f;
66
}
67
}
68
m_toGenerate
=
MathUtils
.
Remainder
(
m_toGenerate
, 1f);
69
if
(
Stopped
&& !flag) {
70
return
true
;
71
}
72
return
false
;
73
}
74
}
75
}
Vector3
Engine.Vector3 Vector3
定义
SubsystemAudio.cs:5
Engine.Graphics.Texture2D
定义
Texture2D.cs:15
Engine.MathUtils
定义
MathUtils.cs:2
Engine.MathUtils.Remainder
static float Remainder(float x, float y)
定义
MathUtils.cs:183
Engine.MathUtils.Min
static int Min(int x1, int x2)
定义
MathUtils.cs:7
Game.ContentManager
定义
ContentManager.cs:50
Game.ContentManager.Get
static object Get(Type type, string name)
定义
ContentManager.cs:70
Game.Particle.IsActive
bool IsActive
定义
Particle.cs:5
Game.ParticleSystem-1-g.TextureSlotsCount
int TextureSlotsCount
定义
ParticleSystem.cs:33
Game.ParticleSystem-1-g.Texture
Texture2D Texture
定义
ParticleSystem.cs:22
Game.ParticleSystem-1-g.ParticleSystem
ParticleSystem(int particlesCount)
定义
ParticleSystem.cs:35
Game.ParticleSystem-1-g.Particles
T[] Particles
定义
ParticleSystem.cs:20
Game.Random
定义
Random.cs:5
Game.ShapeshiftParticleSystem.Particle
定义
ShapeshiftParticleSystem.cs:6
Game.ShapeshiftParticleSystem.Particle.Duration
float Duration
定义
ShapeshiftParticleSystem.cs:9
Game.ShapeshiftParticleSystem.Particle.Velocity
Vector3 Velocity
定义
ShapeshiftParticleSystem.cs:11
Game.ShapeshiftParticleSystem.Particle.Time
float Time
定义
ShapeshiftParticleSystem.cs:7
Game.ShapeshiftParticleSystem.BoundingBox
BoundingBox BoundingBox
定义
ShapeshiftParticleSystem.cs:24
Game.ShapeshiftParticleSystem.m_random
Random m_random
定义
ShapeshiftParticleSystem.cs:14
Game.ShapeshiftParticleSystem.Simulate
override bool Simulate(float dt)
定义
ShapeshiftParticleSystem.cs:31
Game.ShapeshiftParticleSystem.m_generationSpeed
float m_generationSpeed
定义
ShapeshiftParticleSystem.cs:16
Game.ShapeshiftParticleSystem.Position
Vector3 Position
定义
ShapeshiftParticleSystem.cs:22
Game.ShapeshiftParticleSystem.Stopped
bool Stopped
定义
ShapeshiftParticleSystem.cs:20
Game.ShapeshiftParticleSystem.m_toGenerate
float m_toGenerate
定义
ShapeshiftParticleSystem.cs:18
Game.ShapeshiftParticleSystem.ShapeshiftParticleSystem
ShapeshiftParticleSystem()
定义
ShapeshiftParticleSystem.cs:26
Engine.Graphics
定义
BaseBatch.cs:1
Engine.Graphics.ShaderParameterType.Vector2
@ Vector2
定义
ShaderParameterType.cs:4
Engine
定义
BaseSound.cs:10
Game
定义
ContentFileBridge.cs:4
Engine.Color
定义
Color.cs:2
Engine.Color.White
static Color White
定义
Color.cs:15
Engine.Vector3
定义
Vector3.cs:2
SurvivalcraftApi 1.8.2.3
Survivalcraft.Windows
Game
ShapeshiftParticleSystem.cs
制作者
1.16.1