mirror of
https://github.com/frizbee19/FebGameJam.git
synced 2026-09-11 08:17:01 +00:00
Merge branch 'main' into riz
This commit is contained in:
13 files changed
+2275
-37
No files matched your search
@@ -34,4 +34,14 @@ public class PlayerMovement : MonoBehaviour
|
||||
controller.Move(horizontalMove * Time.fixedDeltaTime, crouch, jump);
|
||||
jump = false;
|
||||
}
|
||||
|
||||
|
||||
public void ChangePos(double x, double y)
|
||||
{
|
||||
transform.position = new Vector2();
|
||||
}
|
||||
/*void OnTriggerEnter2D(Collider2D col)
|
||||
{
|
||||
Debug.Log("Trigger Detected!");
|
||||
}*/
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5e8d962f546e27c4f9ecbed3f4ab3daf
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,63 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class WallTrigger : MonoBehaviour
|
||||
{
|
||||
bool entered = false;
|
||||
public GameObject cam;
|
||||
public GameObject cat;
|
||||
private int counter = 0;
|
||||
private Vector3 moveCam = new Vector3(20,0,0);
|
||||
private Vector3 moveCat = new Vector3(4,0,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 (Input.GetButtonDown("Interact"))
|
||||
{
|
||||
Interact(col);
|
||||
}
|
||||
if (!entered && counter >= 120)
|
||||
{
|
||||
entered = true;
|
||||
|
||||
//Debug.Log("Move Cam Right");
|
||||
cam.transform.position += moveCam;
|
||||
cat.transform.position += moveCat;
|
||||
//Debug.Log(counter);
|
||||
counter = 0;
|
||||
//PlayerMovement.ChangePos(1, 2);
|
||||
}
|
||||
else if (counter >= 120 && entered)
|
||||
{
|
||||
//Debug.Log("Moved cam left");
|
||||
//Debug.Log(counter);
|
||||
cam.transform.position -= moveCam;
|
||||
cat.transform.position -= moveCat;
|
||||
entered = false;
|
||||
|
||||
counter = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void Interact(Collider2D col)
|
||||
{
|
||||
Debug.Log("Interact Buttion Pressed!!");
|
||||
}
|
||||
|
||||
/*void Interact(Collider2D col, ){
|
||||
*
|
||||
}*/
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9e34ddf7efd0cb44ba69abc06b6567d4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in new issue
Block a user