Boss Level vorerst fertig zum testen (Animationen für Königin/Josh fehlen noch)

This commit is contained in:
GungHolo
2023-06-22 16:08:30 +02:00
parent 31185531d0
commit 279e8976af
18 changed files with 1886 additions and 435 deletions

View File

@@ -0,0 +1,52 @@
using System.Collections;
using UnityEngine;
using UnityEngine.Serialization;
/*
WICHTIG
Für dieses Script muss ein Object namens "RespawnProjectile" vorhanden sein an dem man wieder spawnt
Collider Disabled Seconds muss so gesetzt werden das das Projectil aus der Quelle rauskommt ohne zerstört zu werden
*/
public class KitchenGunBossMod : MonoBehaviour
{
private Bang bullet;
private IEnumerator coroutine;
// The shot projectiles
public GameObject projectilePrefab;
// Time between shots, game needs to be restarted to take effect
public float shotIntervalSeconds = 1f;
// Time alive for the projectiles or until they hit something
public float shotAliveSeconds = 1f;
// Time until collider gets enabled
public float colliderDisabledSeconds = .2f;
// Speed of projectiles
public Vector2 shotSpeed = new Vector2(1f, 0f);
// Smallest step size for shot speed
private short shotSpeedStepSize = 50;
[SerializeField] private bool dim1;
private Transform dim;
// Start is called before the first frame update
void Start()
{
if(dim1){dim=GameObject.Find("Dim1").transform;} else {dim=GameObject.Find("Dim2").transform;}
bullet = GameObject.Find("DimAll").GetComponent<Bang>();
InvokeRepeating("RecurringBang",0f,shotIntervalSeconds);
}
// Update is called once per frame
void Update()
{
}
void RecurringBang()
{
coroutine = bullet.Banger(projectilePrefab, transform, dim, shotSpeed, colliderDisabledSeconds, shotAliveSeconds);
StartCoroutine(coroutine);
}
}