Merge branch 'master' of https://gitlab.nicholasnovak.io/fums/ofb
This commit is contained in:
commit
7e75fd24ce
@ -2452,6 +2452,7 @@ MonoBehaviour:
|
||||
yDown: 0
|
||||
movementVectorVertical: {x: 0, y: 1}
|
||||
moveSpeed: 1
|
||||
isPlayingDefeatAnimation: 0
|
||||
--- !u!251 &87289533
|
||||
PlatformEffector2D:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -3278,6 +3279,7 @@ MonoBehaviour:
|
||||
yDown: 0
|
||||
movementVectorVertical: {x: 0, y: 1}
|
||||
moveSpeed: 1
|
||||
isPlayingDefeatAnimation: 0
|
||||
--- !u!251 &125680466
|
||||
PlatformEffector2D:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -8140,6 +8142,7 @@ MonoBehaviour:
|
||||
yDown: 0
|
||||
movementVectorVertical: {x: 0, y: 1}
|
||||
moveSpeed: 2.5
|
||||
isPlayingDefeatAnimation: 0
|
||||
--- !u!251 &331950546
|
||||
PlatformEffector2D:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -8264,6 +8267,7 @@ MonoBehaviour:
|
||||
yDown: 0
|
||||
movementVectorVertical: {x: 0, y: 1}
|
||||
moveSpeed: 1
|
||||
isPlayingDefeatAnimation: 0
|
||||
--- !u!251 &334660644
|
||||
PlatformEffector2D:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -16626,6 +16630,7 @@ MonoBehaviour:
|
||||
yDown: 0
|
||||
movementVectorVertical: {x: 0, y: 1}
|
||||
moveSpeed: 1
|
||||
isPlayingDefeatAnimation: 0
|
||||
--- !u!251 &685337255
|
||||
PlatformEffector2D:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -21226,11 +21231,11 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7938030115108489908, guid: fff4dbc75abf546fe8c72b078d034f73, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 42.22651
|
||||
value: 40.35
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7938030115108489908, guid: fff4dbc75abf546fe8c72b078d034f73, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: -0.976223
|
||||
value: -4.2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7938030115108489908, guid: fff4dbc75abf546fe8c72b078d034f73, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
@ -21918,6 +21923,7 @@ MonoBehaviour:
|
||||
yDown: 0
|
||||
movementVectorVertical: {x: 0, y: 1}
|
||||
moveSpeed: 1
|
||||
isPlayingDefeatAnimation: 0
|
||||
--- !u!251 &870280021
|
||||
PlatformEffector2D:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -22777,6 +22783,7 @@ MonoBehaviour:
|
||||
yDown: 0
|
||||
movementVectorVertical: {x: 0, y: 1}
|
||||
moveSpeed: 1
|
||||
isPlayingDefeatAnimation: 0
|
||||
--- !u!251 &889351566
|
||||
PlatformEffector2D:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -25591,6 +25598,7 @@ MonoBehaviour:
|
||||
yDown: 0
|
||||
movementVectorVertical: {x: 0, y: 1}
|
||||
moveSpeed: 1
|
||||
isPlayingDefeatAnimation: 0
|
||||
--- !u!251 &1009495252
|
||||
PlatformEffector2D:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -43296,6 +43304,7 @@ MonoBehaviour:
|
||||
yDown: 0
|
||||
movementVectorVertical: {x: 0, y: 1}
|
||||
moveSpeed: 2.5
|
||||
isPlayingDefeatAnimation: 0
|
||||
--- !u!251 &1767761847
|
||||
PlatformEffector2D:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -50428,6 +50437,7 @@ MonoBehaviour:
|
||||
yDown: 0
|
||||
movementVectorVertical: {x: 0, y: 1}
|
||||
moveSpeed: 2.5
|
||||
isPlayingDefeatAnimation: 0
|
||||
--- !u!251 &2042660774
|
||||
PlatformEffector2D:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -50552,6 +50562,7 @@ MonoBehaviour:
|
||||
yDown: 0
|
||||
movementVectorVertical: {x: 0, y: 1}
|
||||
moveSpeed: 1
|
||||
isPlayingDefeatAnimation: 0
|
||||
--- !u!251 &2047200187
|
||||
PlatformEffector2D:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -23,6 +23,7 @@ public class EnemyPatrol : MonoBehaviour {
|
||||
[Header("General")]
|
||||
public float moveSpeed;
|
||||
Animator animator;
|
||||
public bool isPlayingDefeatAnimation = false;
|
||||
|
||||
void Awake() {
|
||||
animator = GetComponent<Animator>();
|
||||
@ -73,11 +74,13 @@ public class EnemyPatrol : MonoBehaviour {
|
||||
}
|
||||
|
||||
IEnumerator Defeat() {
|
||||
isPlayingDefeatAnimation = true;
|
||||
this.gameObject.GetComponent<BoxCollider2D>().enabled = false;
|
||||
animator.Play("Explosion");
|
||||
this.gameObject.GetComponent<AudioSource>().Play();
|
||||
yield return new WaitForSeconds(animator.GetCurrentAnimatorStateInfo(0).length);
|
||||
this.gameObject.GetComponent<BoxCollider2D>().enabled = true;
|
||||
isPlayingDefeatAnimation = false;
|
||||
this.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
|
@ -203,6 +203,9 @@ public class StateController : MonoBehaviour
|
||||
{
|
||||
foreach (GameObject enemy in enemiesInScene)
|
||||
{
|
||||
if (enemy.GetComponent<EnemyPatrol>().isPlayingDefeatAnimation) {
|
||||
enemy.SetActive(false);
|
||||
}
|
||||
enemy.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user