init
This commit is contained in:
commit
16da8e4dde
333 changed files with 109229 additions and 0 deletions
37
Assets/Scripts/DeathParticle.cs
Normal file
37
Assets/Scripts/DeathParticle.cs
Normal file
|
@ -0,0 +1,37 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class DeathParticle : MonoBehaviour, IPooledObject{
|
||||
|
||||
public Color level1Color;
|
||||
public Color level2Color;
|
||||
public Color level3Color;
|
||||
|
||||
GameController gameController;
|
||||
|
||||
// Start is called before the first frame update
|
||||
public void OnObjectSpawn(){
|
||||
gameController = FindObjectOfType<GameController>();
|
||||
if (gameController.level == 1 || gameController.level == 0){
|
||||
ParticleSystem ps = GetComponent<ParticleSystem>();
|
||||
var main = ps.main;
|
||||
main.startColor = level1Color;
|
||||
}
|
||||
if (gameController.level == 2){
|
||||
ParticleSystem ps = GetComponent<ParticleSystem>();
|
||||
var main = ps.main;
|
||||
main.startColor = level2Color;
|
||||
}
|
||||
if (gameController.level == 3){
|
||||
ParticleSystem ps = GetComponent<ParticleSystem>();
|
||||
var main = ps.main;
|
||||
main.startColor = level3Color;
|
||||
}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue