Merge remote-tracking branch 'origin/main' into beni

This commit is contained in:
MindfulMinun committed 2022-02-25 21:02:59 -06:00
commit 7a16dc24d2
18 files changed
+2861 -72

No files matched your search

+1
View File
@@ -40,6 +40,7 @@ public class Bird : MonoBehaviour
Vector3 targetVelocity = new Vector2(horizontalMove, Mathf.Sin(elapsed * frequency) * deltaY);
// And then smoothing it out and applying it to the character
m_Rigidbody2D.velocity = Vector3.SmoothDamp(m_Rigidbody2D.velocity, targetVelocity, ref m_Velocity, m_MovementSmoothing);
}
else {
m_Rigidbody2D.velocity = Vector3.zero;
+31
View File
@@ -0,0 +1,31 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SpawnTrigger : Trigger
{
[SerializeField] float despawnTimer = 10f;
[SerializeField] GameObject entity;
[SerializeField] Vector2 startPos;
private GameObject clone;
private bool spawned;
//And function itself
IEnumerator SpawnDespawn(){
clone = Instantiate(entity, startPos, Quaternion.identity);
clone.gameObject.SetActive(true);
yield return new WaitForSeconds(despawnTimer);
Destroy(clone);
this.gameObject.SetActive(false);
}
public override void Action() {
if(!spawned) {
Debug.Log("spawn");
StartCoroutine(SpawnDespawn());
}
}
// Start is called before the first frame update
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 55be82907c3918e408296a2532d38fff
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: