enemy spawner

This commit is contained in:
2025-10-26 14:17:31 +01:00
parent 20d3b46834
commit 40a62b5b5a
2102 changed files with 1255290 additions and 70 deletions

View File

@@ -0,0 +1,42 @@
//--------------------------------------------------------------------------------------------------------------------------------
// Cartoon FX
// (c) 2012-2025 Jean Moreno
//--------------------------------------------------------------------------------------------------------------------------------
using UnityEngine;
namespace CartoonFX
{
public class CFXR_Demo_Translate : MonoBehaviour
{
public Vector3 direction = new Vector3(0,1,0);
public bool randomRotation;
bool initialized;
Vector3 initialPosition;
void Awake()
{
if (!initialized)
{
initialized = true;
initialPosition = this.transform.position;
}
}
void OnEnable()
{
this.transform.position = initialPosition;
if (randomRotation)
{
this.transform.eulerAngles = Vector3.Lerp(Vector3.zero, Vector3.up * 360, Random.value);
}
}
void Update()
{
this.transform.Translate(direction * Time.deltaTime);
}
}
}