Crowds level basically finished

Helping zoe next on her camera change!
This commit is contained in:
Unknown committed 2022-02-26 20:44:14 -06:00
1 parent 8c084b2e01
commit 61a7f5984b
3 files changed
+4626 -21

No files matched your search

File diff suppressed because it is too large. Load diff
+3 -3
View File
@@ -10,7 +10,7 @@ public class Ceiling_Trigger : MonoBehaviour
private int counter = 0;
[Range (1f,25f)]public float camOffset = 10f;
[Range (1f,15f)] public float catOffset = 5f;
[Range(5, 180)] public int countOffset = 10;
[Range(3, 180)] public int countOffset = 10;
private LayerMask layerMask;
private Vector3 moveCam;
private Vector3 moveCat;
@@ -32,13 +32,13 @@ public class Ceiling_Trigger : MonoBehaviour
{
float ye = cat.transform.position.y;
float goaly = box.transform.position.y;
if ((ye < goaly && counter >= countOffset))
if ((ye < goaly && counter >= countOffset) && (col.gameObject.tag == "Player"))
{
cam.transform.position += moveCam;
cat.transform.position += moveCat;
counter = 0;
}
else if ((ye >= goaly && counter > countOffset))
else if ((ye >= goaly && counter > countOffset) && (col.gameObject.tag == "Player"))
{
cam.transform.position -= moveCam;
cat.transform.position -= moveCat;
+4 -4
View File
@@ -8,8 +8,8 @@ public class WorkingWallTrigger : MonoBehaviour
public GameObject cat;
public BoxCollider2D box;
private int counter = 0;
[Range(1f, 25f)] public float camOffset = 10f;
[Range(1f, 15f)] public float catOffset = 5f;
[Range(-25f, 25f)] public float camOffset = 10f;
[Range(-15f, 15f)] public float catOffset = 5f;
[Range(5, 180)] public int countOffset = 10;
private Vector3 moveCam;
private Vector3 moveCat;
@@ -33,13 +33,13 @@ public class WorkingWallTrigger : MonoBehaviour
{
float xe = cat.transform.position.x;
float goalx = box.transform.localPosition.x;
if (xe < goalx && counter >= countOffset)
if (xe < goalx && counter >= countOffset && (col.gameObject.tag == "Player"))
{
cam.transform.position += moveCam;
cat.transform.position += moveCat;
counter = 0;
}
else if (xe >= goalx && counter > countOffset)
else if (xe >= goalx && counter > countOffset && (col.gameObject.tag == "Player"))
{
cam.transform.position -= moveCam;
cat.transform.position -= moveCat;