mirror of
https://github.com/frizbee19/FebGameJam.git
synced 2026-09-11 08:17:01 +00:00
Moved Some stuff around before the merge
I move stuff :)
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Ceiling_Trigger : MonoBehaviour
|
||||
{
|
||||
|
||||
bool entered = false;
|
||||
public GameObject cam;
|
||||
public GameObject cat;
|
||||
private int counter = 0;
|
||||
private Vector3 moveCam = new Vector3(0, 10, 0);
|
||||
private Vector3 moveCat = new Vector3(0, 3, 0);
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
counter++;
|
||||
}
|
||||
void OnTriggerEnter2D(Collider2D col)
|
||||
{
|
||||
if (!entered && counter >= 69)
|
||||
{
|
||||
entered = true;
|
||||
|
||||
//Debug.Log("Move Cam Right");
|
||||
cam.transform.position += moveCam;
|
||||
cat.transform.position += moveCat;
|
||||
Debug.Log(counter);
|
||||
counter = 0;
|
||||
}
|
||||
else if (counter >= 69 && entered)
|
||||
{
|
||||
//Debug.Log("Moved cam left");
|
||||
Debug.Log(counter);
|
||||
cam.transform.position -= moveCam;
|
||||
//cat.transform.position -= moveCat;
|
||||
entered = false;
|
||||
counter = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user