Gewehr sollte jetzt vollständig Funktionieren mitsamt Schusseffekten und Bugfixing. Es fehlen noch anpassungen an Balancingwerten. Als nächstes sollte Gegner Hit-Registrierung und Combat dessen Seite anstehen, dann weitere Türme zur Verteidigung.
This commit is contained in:
1 parent
e8c81646c4
commit
9367275e8d
17 files changed
+591
-418
No files matched your search
@@ -0,0 +1,28 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class DestroyAfterAnimation : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private Animator animator;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (animator == null)
|
||||
animator = GetComponent<Animator>();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (animator == null)
|
||||
return;
|
||||
|
||||
AnimatorStateInfo state =
|
||||
animator.GetCurrentAnimatorStateInfo(0);
|
||||
|
||||
if (state.normalizedTime >= 1f
|
||||
&& !animator.IsInTransition(0))
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user