start scene bug fix
This commit is contained in:
@@ -65,16 +65,6 @@ public class DropletMovement : MonoBehaviour
|
|||||||
rb.linearVelocity = new Vector2(rb.linearVelocity.x, jumpingPower);
|
rb.linearVelocity = new Vector2(rb.linearVelocity.x, jumpingPower);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Jump animation
|
|
||||||
|
|
||||||
// if (rb.linearVelocityY < fallingAnimationVelocityThreshold && !isGrounded)
|
|
||||||
// {
|
|
||||||
// animator.SetBool("Falling", true);
|
|
||||||
// } else
|
|
||||||
// {
|
|
||||||
// animator.SetBool("Falling", false);
|
|
||||||
// }
|
|
||||||
|
|
||||||
//Walk animation
|
//Walk animation
|
||||||
if (movement.x > 0) {
|
if (movement.x > 0) {
|
||||||
animator.SetBool("WalkingRight", true);
|
animator.SetBool("WalkingRight", true);
|
||||||
@@ -125,7 +115,7 @@ public class DropletMovement : MonoBehaviour
|
|||||||
if (other.CompareTag("Hole"))
|
if (other.CompareTag("Hole"))
|
||||||
{
|
{
|
||||||
SceneManager.LoadScene(2, LoadSceneMode.Single);
|
SceneManager.LoadScene(2, LoadSceneMode.Single);
|
||||||
Destroy(gameObject);
|
//Destroy(gameObject);
|
||||||
Debug.Log("Fell in hole!");
|
Debug.Log("Fell in hole!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,12 @@ using UnityEngine;
|
|||||||
|
|
||||||
public class FalldownScene : MonoBehaviour
|
public class FalldownScene : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
public GameObject targetObject;
|
||||||
|
|
||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
|
targetObject = GameObject.FindGameObjectWithTag("Player");
|
||||||
|
Destroy(targetObject);
|
||||||
// This tells Unity NOT to destroy this object when loading a new scene
|
// This tells Unity NOT to destroy this object when loading a new scene
|
||||||
DontDestroyOnLoad(gameObject);
|
DontDestroyOnLoad(gameObject);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,12 @@ using UnityEngine;
|
|||||||
|
|
||||||
public class HoleDeath : MonoBehaviour
|
public class HoleDeath : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
public GameObject targetObject;
|
||||||
|
|
||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
|
targetObject = GameObject.FindGameObjectWithTag("Player");
|
||||||
|
Destroy(targetObject);
|
||||||
// This tells Unity NOT to destroy this object when loading a new scene
|
// This tells Unity NOT to destroy this object when loading a new scene
|
||||||
DontDestroyOnLoad(gameObject);
|
DontDestroyOnLoad(gameObject);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user