Skip to content

Commit

Permalink
particle system deletion fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kiamvdd committed Jul 5, 2017
1 parent 47f7acb commit e67a800
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 19 deletions.
20 changes: 20 additions & 0 deletions JustATest/Assets/ParticleAutoDestroy.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ParticleAutoDestroy : MonoBehaviour {

// Use this for initialization
private ParticleSystem _system;
void Start () {
_system = GetComponent<ParticleSystem>();
}

// Update is called once per frame
void Update () {
if (!_system.IsAlive())
{
Destroy(this.gameObject);
}
}
}
12 changes: 12 additions & 0 deletions JustATest/Assets/ParticleAutoDestroy.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified JustATest/Assets/Prefabs/Explosion.prefab
Binary file not shown.
Binary file modified JustATest/Assets/Prefabs/Grenade.prefab
Binary file not shown.
Binary file modified JustATest/Assets/Prefabs/ObjectDestroy.prefab
Binary file not shown.
Binary file modified JustATest/Assets/Prefabs/UpgradeEffect.prefab
Binary file not shown.
Binary file modified JustATest/Assets/Prefabs/Wall.prefab
Binary file not shown.
5 changes: 0 additions & 5 deletions JustATest/Assets/Scripts/EMPItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,6 @@ void AttachToThruster()

void Explode()
{
for (int i = 0; i < _thrusters.Count; i++)
{
_thrusters[_thrusterID].IsHighlighted = false;
}

_billboard.SetActive(false);
_mesh.SetActive(false);
GlobalSoundManager.instance.PlayStopEmp(false);
Expand Down
2 changes: 1 addition & 1 deletion JustATest/Assets/Scripts/GrenadeItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class GrenadeItem : MonoBehaviour, IItem {
private Vector3 _spinDir;

[SerializeField]
Explosion ExplosionPrefab;
GameObject ExplosionPrefab;

public bool Grab(Transform origin)
{
Expand Down
2 changes: 1 addition & 1 deletion JustATest/Assets/Scripts/WallController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public float UpgradeTimer
[SerializeField]
float MaxFieldWidth;
[SerializeField]
Explosion ExplosionPrefab;
GameObject ExplosionPrefab;
public bool LeftWon = false;
public bool RightWon = false;

Expand Down
7 changes: 5 additions & 2 deletions JustATest/JustATest.CSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Assets\GlobalSoundManager.cs" />
<Compile Include="Assets\ParticleAutoDestroy.cs" />
<Compile Include="Assets\PostProcessing\Runtime\Attributes\GetSetAttribute.cs" />
<Compile Include="Assets\PostProcessing\Runtime\Attributes\MinAttribute.cs" />
<Compile Include="Assets\PostProcessing\Runtime\Attributes\TrackballAttribute.cs" />
Expand Down Expand Up @@ -125,11 +125,14 @@
<Compile Include="Assets\Scripts\CameraController.cs" />
<Compile Include="Assets\Scripts\EMPItem.cs" />
<Compile Include="Assets\Scripts\Explosion.cs" />
<Compile Include="Assets\Scripts\FloorAnimator.cs" />
<Compile Include="Assets\Scripts\FuelController.cs" />
<Compile Include="Assets\Scripts\GameManager.cs" />
<Compile Include="Assets\Scripts\GlobalSoundManager.cs" />
<Compile Include="Assets\Scripts\GrenadeItem.cs" />
<Compile Include="Assets\Scripts\IItem.cs" />
<Compile Include="Assets\Scripts\ItemHandler.cs" />
<Compile Include="Assets\Scripts\MagnetController.cs" />
<Compile Include="Assets\Scripts\MenuController.cs" />
<Compile Include="Assets\Scripts\ObjectController.cs" />
<Compile Include="Assets\Scripts\PlayerController.cs" />
Expand All @@ -138,10 +141,10 @@
<Compile Include="Assets\Scripts\TextureOffsetController.cs" />
<Compile Include="Assets\Scripts\Thruster.cs" />
<Compile Include="Assets\Scripts\ThrusterButton.cs" />
<Compile Include="Assets\Scripts\TimerController.cs" />
<Compile Include="Assets\Scripts\UVOffsetController.cs" />
<Compile Include="Assets\Scripts\WallController.cs" />
<Compile Include="Assets\Scripts\Waypoint.cs" />
<Compile Include="Assets\TimerController.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Assets\PostProcessing\Editor Resources\Monitors\HistogramCompute.compute" />
Expand Down
20 changes: 10 additions & 10 deletions JustATest/JustATest.sln
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2015
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JustATest", "JustATest.csproj", "{D1933A70-366E-5E11-65B2-372C7CDB40E1}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JustATest.CSharp", "JustATest.CSharp.csproj", "{FD9B50BC-72BB-478C-CD01-E0D42AC50E1A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JustATest.Editor", "JustATest.Editor.csproj", "{B1D98C20-72E7-04A6-3DAB-59137D38656C}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JustATest.CSharp.Editor", "JustATest.CSharp.Editor.csproj", "{BAFF4C6E-0A77-D6E1-E73C-0B780F390A54}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D1933A70-366E-5E11-65B2-372C7CDB40E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D1933A70-366E-5E11-65B2-372C7CDB40E1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D1933A70-366E-5E11-65B2-372C7CDB40E1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D1933A70-366E-5E11-65B2-372C7CDB40E1}.Release|Any CPU.Build.0 = Release|Any CPU
{B1D98C20-72E7-04A6-3DAB-59137D38656C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B1D98C20-72E7-04A6-3DAB-59137D38656C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B1D98C20-72E7-04A6-3DAB-59137D38656C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B1D98C20-72E7-04A6-3DAB-59137D38656C}.Release|Any CPU.Build.0 = Release|Any CPU
{FD9B50BC-72BB-478C-CD01-E0D42AC50E1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FD9B50BC-72BB-478C-CD01-E0D42AC50E1A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FD9B50BC-72BB-478C-CD01-E0D42AC50E1A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FD9B50BC-72BB-478C-CD01-E0D42AC50E1A}.Release|Any CPU.Build.0 = Release|Any CPU
{BAFF4C6E-0A77-D6E1-E73C-0B780F390A54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BAFF4C6E-0A77-D6E1-E73C-0B780F390A54}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BAFF4C6E-0A77-D6E1-E73C-0B780F390A54}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BAFF4C6E-0A77-D6E1-E73C-0B780F390A54}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit e67a800

Please sign in to comment.