Skip to content

Commit b8d07ac

Browse files
committed
changed
1 parent 1d6cbc1 commit b8d07ac

3 files changed

Lines changed: 278 additions & 240 deletions

File tree

BDAnimationModules/BDAnimationModules.csproj

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,28 +101,71 @@
101101
<Compile Include="BDTextureSwitch.cs" />
102102
</ItemGroup>
103103
<ItemGroup>
104-
<Reference Include="Assembly-CSharp">
105-
<HintPath>E:\Program Files (x86)\Steam\SteamApps\common\Kerbal Space Program\KSP_x64_Data\Managed\Assembly-CSharp.dll</HintPath>
104+
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
105+
<SpecificVersion>False</SpecificVersion>
106+
<HintPath>E:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\Assembly-CSharp.dll</HintPath>
106107
<Private>False</Private>
107108
</Reference>
108-
<Reference Include="Assembly-CSharp-firstpass">
109-
<HintPath>E:\Program Files (x86)\Steam\SteamApps\common\Kerbal Space Program\KSP_x64_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
110-
<Private>False</Private>
111-
</Reference>
112-
<Reference Include="KSPAssets">
113-
<HintPath>E:\Program Files (x86)\Steam\SteamApps\common\Kerbal Space Program\KSP_x64_Data\Managed\KSPAssets.dll</HintPath>
109+
<Reference Include="Assembly-CSharp-firstpass, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
110+
<SpecificVersion>False</SpecificVersion>
111+
<HintPath>E:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
114112
<Private>False</Private>
115113
</Reference>
116114
<Reference Include="System" />
115+
<Reference Include="System.Core" />
116+
<Reference Include="System.Xml.Linq" />
117+
<Reference Include="System.Data.DataSetExtensions" />
118+
<Reference Include="System.Data" />
119+
<Reference Include="System.Xml" />
117120
<Reference Include="UnityEngine">
118-
<HintPath>E:\Program Files (x86)\Steam\SteamApps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.dll</HintPath>
121+
<HintPath>E:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.dll</HintPath>
122+
<Private>False</Private>
123+
</Reference>
124+
<Reference Include="UnityEngine.AnimationModule">
125+
<HintPath>E:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.AnimationModule.dll</HintPath>
126+
<Private>False</Private>
127+
</Reference>
128+
<Reference Include="UnityEngine.AudioModule">
129+
<HintPath>E:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.AudioModule.dll</HintPath>
130+
<Private>False</Private>
131+
</Reference>
132+
<Reference Include="UnityEngine.CoreModule">
133+
<HintPath>E:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
134+
<Private>False</Private>
135+
</Reference>
136+
<Reference Include="UnityEngine.IMGUIModule">
137+
<HintPath>E:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
138+
<Private>False</Private>
139+
</Reference>
140+
<Reference Include="UnityEngine.InputLegacyModule">
141+
<HintPath>E:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.InputLegacyModule.dll</HintPath>
142+
<Private>False</Private>
143+
</Reference>
144+
<Reference Include="UnityEngine.InputModule">
145+
<HintPath>E:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.InputModule.dll</HintPath>
146+
<Private>False</Private>
147+
</Reference>
148+
<Reference Include="UnityEngine.PhysicsModule">
149+
<HintPath>E:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.PhysicsModule.dll</HintPath>
150+
<Private>False</Private>
151+
</Reference>
152+
<Reference Include="UnityEngine.TextRenderingModule">
153+
<HintPath>E:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.TextRenderingModule.dll</HintPath>
119154
<Private>False</Private>
120155
</Reference>
121156
<Reference Include="UnityEngine.UI">
122-
<HintPath>E:\Program Files (x86)\Steam\SteamApps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.UI.dll</HintPath>
157+
<HintPath>E:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.UI.dll</HintPath>
123158
<Private>False</Private>
124159
</Reference>
125-
</ItemGroup>
160+
<Reference Include="UnityEngine.UIModule">
161+
<HintPath>E:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.UIModule.dll</HintPath>
162+
<Private>False</Private>
163+
</Reference>
164+
<Reference Include="UnityEngine.VehiclesModule">
165+
<HintPath>E:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.VehiclesModule.dll</HintPath>
166+
<Private>False</Private>
167+
</Reference>
168+
</ItemGroup>
126169
<ItemGroup>
127170
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
128171
<Visible>False</Visible>
Lines changed: 103 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,109 @@
11
using UnityEngine;
22

3-
4-
public class FSBDparticleFX
5-
{
6-
7-
public GameObject gameObject;
8-
public GameObject parentObject;
9-
public Texture particleTexture;
10-
public bool useLocalSpaceVelocityHack = false;
11-
12-
public ParticleEmitter pEmitter;
13-
public ParticleRenderer pRenderer;
14-
public ParticleAnimator pAnimator;
15-
16-
private bool componentsAdded = false;
17-
18-
#region component variables
19-
20-
public string RendererShader = "Particles/Alpha Blended";
21-
22-
public float EmitterMinSize = 0.1f;
23-
public float EmitterMaxSize = 0.2f;
24-
public float EmitterMinEnergy = 0.1f;
25-
public float EmitterMaxEnergy = 0.8f;
26-
public float EmitterMinEmission = 120f;
27-
public float EmitterMaxEmission = 160f;
28-
public Vector3 EmitterLocalVelocity = new Vector3(0f, 0f, 1f);
29-
public Vector3 EmitterRndVelocity = new Vector3(0f, 0.1f, 0.1f);
30-
public bool EmitterUseWorldSpace = true;
31-
public bool EmitterRandomRotation = true;
32-
33-
public bool AnimatorDoesAnimateColor = true;
34-
35-
public Color AnimatorColor0 = new Color(0.2f, 0.2f, 0.2f, 0.1f);
36-
public Color AnimatorColor1 = new Color(0.3f, 0.3f, 0.3f, 0.1f);
37-
public Color AnimatorColor2 = new Color(0.5f, 0.5f, 0.5f, 0.09f);
38-
public Color AnimatorColor3 = new Color(0.8f, 0.8f, 0.8f, 0.07f);
39-
public Color AnimatorColor4 = new Color(1f, 1f, 1f, 0.05f);
40-
41-
public float AnimatorSizeGrow = 0.5f;
42-
43-
#endregion
44-
45-
public FSBDparticleFX(GameObject _gameObject, Texture2D _particleTexture)
46-
{
47-
gameObject = _gameObject;
48-
particleTexture = _particleTexture;
49-
}
50-
51-
private void addComponents()
52-
{
53-
pEmitter = (ParticleEmitter)gameObject.AddComponent(typeof(MeshParticleEmitter));
54-
pRenderer = gameObject.AddComponent<ParticleRenderer>();
55-
pAnimator = gameObject.AddComponent<ParticleAnimator>();
56-
}
57-
58-
public void setupFXValues()
59-
{
60-
if (!componentsAdded)
61-
{
62-
addComponents();
63-
componentsAdded = true;
64-
}
65-
pRenderer.materials = new Material[1];
66-
pRenderer.materials[0].shader = Shader.Find(RendererShader);
67-
pRenderer.materials[0].mainTexture = particleTexture;
68-
69-
pEmitter.minSize = EmitterMinSize;
70-
pEmitter.maxSize = EmitterMaxSize;
71-
pEmitter.minEnergy = EmitterMinEnergy;
72-
pEmitter.maxEnergy = EmitterMaxEnergy;
73-
pEmitter.minEmission = EmitterMinEmission;
74-
pEmitter.maxEmission = EmitterMaxEmission;
75-
pEmitter.localVelocity = EmitterLocalVelocity;
76-
pEmitter.rndVelocity = EmitterRndVelocity;
77-
pEmitter.useWorldSpace = EmitterUseWorldSpace;
78-
79-
pAnimator.doesAnimateColor = AnimatorDoesAnimateColor;
80-
81-
Color[] colorAnimation = pAnimator.colorAnimation;
82-
colorAnimation[0] = AnimatorColor0;
83-
colorAnimation[1] = AnimatorColor1;
84-
colorAnimation[2] = AnimatorColor2;
85-
colorAnimation[3] = AnimatorColor3;
86-
colorAnimation[4] = AnimatorColor4;
87-
pAnimator.colorAnimation = colorAnimation;
88-
89-
pAnimator.sizeGrow = AnimatorSizeGrow;
90-
}
91-
92-
public void updateFX()
93-
{
3+
namespace Firespitter
4+
{
5+
//RBP - Deprecating this due to particle system changes.
6+
public class FSBDparticleFX
7+
{
8+
9+
//public GameObject gameObject;
10+
//public GameObject parentObject;
11+
//public Texture particleTexture;
12+
//public bool useLocalSpaceVelocityHack = false;
13+
14+
//public ParticleEmitter pEmitter;
15+
//public ParticleRenderer pRenderer;
16+
//public ParticleAnimator pAnimator;
17+
18+
//private bool componentsAdded = false;
19+
20+
//#region component variables
21+
22+
//public string RendererShader = "Particles/Alpha Blended";
23+
24+
//public float EmitterMinSize = 0.1f;
25+
//public float EmitterMaxSize = 0.2f;
26+
//public float EmitterMinEnergy = 0.1f;
27+
//public float EmitterMaxEnergy = 0.8f;
28+
//public float EmitterMinEmission = 120f;
29+
//public float EmitterMaxEmission = 160f;
30+
//public Vector3 EmitterLocalVelocity = new Vector3(0f, 0f, 1f);
31+
//public Vector3 EmitterRndVelocity = new Vector3(0f, 0.1f, 0.1f);
32+
//public bool EmitterUseWorldSpace = true;
33+
//public bool EmitterRandomRotation = true;
34+
35+
//public bool AnimatorDoesAnimateColor = true;
36+
37+
//public Color AnimatorColor0 = new Color(0.2f, 0.2f, 0.2f, 0.1f);
38+
//public Color AnimatorColor1 = new Color(0.3f, 0.3f, 0.3f, 0.1f);
39+
//public Color AnimatorColor2 = new Color(0.5f, 0.5f, 0.5f, 0.09f);
40+
//public Color AnimatorColor3 = new Color(0.8f, 0.8f, 0.8f, 0.07f);
41+
//public Color AnimatorColor4 = new Color(1f, 1f, 1f, 0.05f);
42+
43+
//public float AnimatorSizeGrow = 0.5f;
44+
45+
//#endregion
46+
47+
//public FSBDparticleFX(GameObject _gameObject, Texture2D _particleTexture)
48+
//{
49+
// gameObject = _gameObject;
50+
// particleTexture = _particleTexture;
51+
//}
52+
53+
//private void addComponents()
54+
//{
55+
// pEmitter = gameObject.AddComponent<MeshParticleEmitter>();
56+
// pRenderer = gameObject.AddComponent<ParticleRenderer>();
57+
// pAnimator = gameObject.AddComponent<ParticleAnimator>();
58+
//}
9459

95-
if (useLocalSpaceVelocityHack)
96-
{
97-
//float velMagnitude = parentObject.rigidbody.velocity.magnitude;
98-
float fxSpeed = Vector3.Dot(gameObject.transform.forward, parentObject.GetComponent<Rigidbody>().velocity);
99-
if (fxSpeed > 0f)
100-
fxSpeed = 0;
101-
pEmitter.localVelocity = new Vector3(0f, 0f, 1f + (-fxSpeed * 0.1f));
102-
//pEmitter.maxEmission = pEmitter.minEmission + (velMagnitude * 3);
103-
}
60+
//public void setupFXValues()
61+
//{
62+
// if (!componentsAdded)
63+
// {
64+
// addComponents();
65+
// componentsAdded = true;
66+
// }
67+
// pRenderer.materials = new Material[1];
68+
// pRenderer.materials[0].shader = Shader.Find(RendererShader);
69+
// pRenderer.materials[0].mainTexture = particleTexture;
70+
71+
// pEmitter.minSize = EmitterMinSize;
72+
// pEmitter.maxSize = EmitterMaxSize;
73+
// pEmitter.minEnergy = EmitterMinEnergy;
74+
// pEmitter.maxEnergy = EmitterMaxEnergy;
75+
// pEmitter.minEmission = EmitterMinEmission;
76+
// pEmitter.maxEmission = EmitterMaxEmission;
77+
// pEmitter.localVelocity = EmitterLocalVelocity;
78+
// pEmitter.rndVelocity = EmitterRndVelocity;
79+
// pEmitter.useWorldSpace = EmitterUseWorldSpace;
80+
81+
// pAnimator.doesAnimateColor = AnimatorDoesAnimateColor;
82+
83+
// Color[] colorAnimation = pAnimator.colorAnimation;
84+
// colorAnimation[0] = AnimatorColor0;
85+
// colorAnimation[1] = AnimatorColor1;
86+
// colorAnimation[2] = AnimatorColor2;
87+
// colorAnimation[3] = AnimatorColor3;
88+
// colorAnimation[4] = AnimatorColor4;
89+
// pAnimator.colorAnimation = colorAnimation;
90+
91+
// pAnimator.sizeGrow = AnimatorSizeGrow;
92+
//}
10493

105-
106-
107-
}
94+
//public void updateFX()
95+
//{
96+
97+
// if (useLocalSpaceVelocityHack)
98+
// {
99+
// //float velMagnitude = parentObject.GetComponent<Rigidbody>().velocity.magnitude;
100+
// float fxSpeed = Vector3.Dot(gameObject.transform.forward, parentObject.GetComponent<Rigidbody>().velocity);
101+
// if (fxSpeed > 0f)
102+
// fxSpeed = 0;
103+
// pEmitter.localVelocity = new Vector3(0f, 0f, 1f + (-fxSpeed * 0.1f));
104+
// //pEmitter.maxEmission = pEmitter.minEmission + (velMagnitude * 3);
105+
// }
106+
//}
108107

108+
}
109109
}

0 commit comments

Comments
 (0)