mirror of
https://github.com/frizbee19/FebGameJam.git
synced 2026-09-11 08:17:01 +00:00
Added Camera switching needs to be smoothed soon
This commit is contained in:
1 parent
80bf0b7702
commit
0de7c077f7
6 files changed
+131
-31
No files matched your search
@@ -25,7 +25,7 @@ public class Ceiling_Trigger : MonoBehaviour
|
||||
}
|
||||
void OnTriggerEnter2D(Collider2D col)
|
||||
{
|
||||
if (!entered && counter >= 69)
|
||||
if (!entered && counter >= 6)
|
||||
{
|
||||
entered = true;
|
||||
|
||||
@@ -35,7 +35,7 @@ public class Ceiling_Trigger : MonoBehaviour
|
||||
Debug.Log(counter);
|
||||
counter = 0;
|
||||
}
|
||||
else if (counter >= 69 && entered)
|
||||
else if (counter >= 6 && entered)
|
||||
{
|
||||
//Debug.Log("Moved cam left");
|
||||
Debug.Log(counter);
|
||||
|
||||
@@ -8,6 +8,9 @@ public class ScriptRayHit : MonoBehaviour
|
||||
public RaycastHit2D hit;
|
||||
public Ray ray;
|
||||
private int counter;
|
||||
public Camera followCam;
|
||||
public Camera staticCam;
|
||||
private bool cam = false;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
@@ -20,8 +23,19 @@ public class ScriptRayHit : MonoBehaviour
|
||||
hit = Physics2D.Raycast(transform.position, transform.TransformDirection(Vector2.right), 4f);
|
||||
if (hit)
|
||||
{
|
||||
//Debug.Log(" Hit a wall "+ hit.collider.name);
|
||||
//Debug.Log(counter);
|
||||
Debug.Log(" Hit a wall "+ hit.collider.name);
|
||||
staticCam.enabled = true;
|
||||
followCam.enabled = false;
|
||||
counter = 0;
|
||||
cam = true;
|
||||
}
|
||||
else if (cam && counter == 30)
|
||||
{
|
||||
staticCam.enabled = false;
|
||||
followCam.enabled = true;
|
||||
counter = 0;
|
||||
cam = false;
|
||||
Debug.Log("");
|
||||
}
|
||||
counter++;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user