Implemented all needed to get a portal working to floor level as well as setting up portals for future game modes

This commit is contained in:
Gregory Campbell
2020-01-11 15:55:01 -05:00
parent 2b6eb87127
commit 31b81f08b9
7 changed files with 1605 additions and 12 deletions
+9 -1
View File
@@ -45,7 +45,7 @@ public class PlayerController : MonoBehaviour
float slideTime = 0.0f;
float wallRunTime = 0.0f;
float respawnTime = 1.0f;
public float respawnTime = 0.0f;
float oneSec = 1.0f;
float halfSec = 0.5f;
float quarterSec = 0.25f;
@@ -81,6 +81,12 @@ public class PlayerController : MonoBehaviour
finished = true;
respawnTime = Time.time;
}
if(hit.gameObject.tag == "Obstacle Portal")
{
SceneManager.LoadScene("Floor Level", LoadSceneMode.Single);
respawnTime = Time.time;
}
}
@@ -290,6 +296,8 @@ public class PlayerController : MonoBehaviour
velocity.z = velocity.z * Mathf.Abs(moveDirection.y);
}
Debug.Log(transform.position);
// Move the controller
if((finished == false || respawn == false) && respawnTime + tenthSec < Time.time)
{