Added health, respawning and Bullet spawners
This commit is contained in:
28
Assets/Scripts/Game/Patterns/RotatingPattern.cs
Normal file
28
Assets/Scripts/Game/Patterns/RotatingPattern.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using static UnityEngine.ParticleSystem;
|
||||
|
||||
public class RotatingPattern : Pattern
|
||||
{
|
||||
public float speed = 1;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void OnPatternUpdate()
|
||||
{
|
||||
// transform.Rotate(Vector3.up, speed * Time.deltaTime);
|
||||
|
||||
//find all particle systems in children
|
||||
ParticleSystem[] systems = GetComponentsInChildren<ParticleSystem>();
|
||||
foreach (ParticleSystem system in systems)
|
||||
{
|
||||
ShapeModule shape = system.shape;
|
||||
shape.rotation = new Vector3(0, shape.rotation.y + speed * Time.deltaTime, 0);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Game/Patterns/RotatingPattern.cs.meta
Normal file
11
Assets/Scripts/Game/Patterns/RotatingPattern.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b5d3d6fc4fb04da4bbc0ebf8895d9423
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user