mirror of
https://github.com/ConjureETS/MeltedBananasOJam2016.git
synced 2026-03-24 02:21:06 +00:00
Fixes to Camera, started Slowmo
This commit is contained in:
parent
e3213fe484
commit
0ca5c8a228
Binary file not shown.
BIN
Assets/Prefabs/Main Camera.prefab
Normal file
BIN
Assets/Prefabs/Main Camera.prefab
Normal file
Binary file not shown.
8
Assets/Prefabs/Main Camera.prefab.meta
Normal file
8
Assets/Prefabs/Main Camera.prefab.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c6315d57d22df49cabe86636b97689d3
|
||||||
|
timeCreated: 1466872062
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -5,7 +5,6 @@ public class PlayerMovement : MonoBehaviour {
|
|||||||
|
|
||||||
public float speed = 0f;
|
public float speed = 0f;
|
||||||
public float turn = 0f;
|
public float turn = 0f;
|
||||||
public GameObject camera;
|
|
||||||
public Rigidbody characterRigidBody;
|
public Rigidbody characterRigidBody;
|
||||||
//private Rigidbody rb;
|
//private Rigidbody rb;
|
||||||
|
|
||||||
@ -13,7 +12,7 @@ public class PlayerMovement : MonoBehaviour {
|
|||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
void Update () {
|
void Update () {
|
||||||
Vector3 fowardVector = new Vector3(camera.transform.forward.x, 0, camera.transform.forward.z);
|
Vector3 fowardVector = new Vector3(Camera.main.transform.forward.x, 0, Camera.main.transform.forward.z);
|
||||||
if (Input.GetAxis("Vertical")>0)
|
if (Input.GetAxis("Vertical")>0)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
38
Assets/Scripts/SlowdownScript.cs
Normal file
38
Assets/Scripts/SlowdownScript.cs
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
public class SlowdownScript : MonoBehaviour {
|
||||||
|
|
||||||
|
private float duration = 5.0f;
|
||||||
|
private bool pickedUp = false;
|
||||||
|
|
||||||
|
// Use this for initialization
|
||||||
|
void Start () {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
if(pickedUp)
|
||||||
|
{
|
||||||
|
Time.timeScale = 0.5f;
|
||||||
|
StartCoroutine(Wait(duration));
|
||||||
|
Time.timeScale = 1.0f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnTriggerEnter(Collider col)
|
||||||
|
{
|
||||||
|
if (col.gameObject.CompareTag("Player"))
|
||||||
|
{
|
||||||
|
pickedUp = true;
|
||||||
|
gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
IEnumerator Wait(float seconds)
|
||||||
|
{
|
||||||
|
yield return new WaitForSeconds(seconds);
|
||||||
|
}
|
||||||
|
}
|
||||||
12
Assets/Scripts/SlowdownScript.cs.meta
Normal file
12
Assets/Scripts/SlowdownScript.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c5d317885d9034ae492a544e9dd04107
|
||||||
|
timeCreated: 1466884297
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
30
Assets/Scripts/SphereMover.cs
Normal file
30
Assets/Scripts/SphereMover.cs
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
public class SphereMover : MonoBehaviour {
|
||||||
|
|
||||||
|
public float speed = 2.0f;
|
||||||
|
private bool bascule = false;
|
||||||
|
|
||||||
|
// Use this for initialization
|
||||||
|
void Start () {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void FixedUpdate()
|
||||||
|
{
|
||||||
|
if (bascule)
|
||||||
|
transform.Translate (Vector2.right * speed * Time.deltaTime);
|
||||||
|
else
|
||||||
|
transform.Translate (-Vector2.right * speed * Time.deltaTime);
|
||||||
|
|
||||||
|
if(transform.position.x >= 4.0f) {
|
||||||
|
bascule = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(transform.position.x <= -4) {
|
||||||
|
bascule = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
Assets/Scripts/SphereMover.cs.meta
Normal file
12
Assets/Scripts/SphereMover.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b82403f7e7f384b7e99b0c400ba33edd
|
||||||
|
timeCreated: 1466879067
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -5,7 +5,6 @@ public class ViewControl : MonoBehaviour
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Speed at which the camera will catch up to the mouse pointer location
|
// Speed at which the camera will catch up to the mouse pointer location
|
||||||
public float smoothing = 1.5f;
|
|
||||||
public float mouseSensitivity = 100.0f;
|
public float mouseSensitivity = 100.0f;
|
||||||
public float clampAngle = 80.0f;
|
public float clampAngle = 80.0f;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user