This commit is contained in:
antoine.mcnabb 2016-06-25 17:43:58 -04:00
commit b46e0b546a
10 changed files with 109 additions and 3 deletions

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c6315d57d22df49cabe86636b97689d3
timeCreated: 1466872062
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -5,7 +5,6 @@ public class PlayerMovement : MonoBehaviour {
public float speed = 0f;
public float turn = 0f;
public GameObject camera;
public Rigidbody characterRigidBody;
//private Rigidbody rb;
@ -13,7 +12,7 @@ public class PlayerMovement : MonoBehaviour {
// Update is called once per frame
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)
{

View 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);
}
}

View 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:

View 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;
}
}
}

View 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:

View File

@ -55,4 +55,12 @@ public class TileController : MonoBehaviour
}
}
void OnTriggerEnter (Collider other)
{
if (other.tag == "DestroyTrigger")
{
Destroy(this.gameObject);
}
}
}

View File

@ -5,7 +5,6 @@ public class ViewControl : MonoBehaviour
{
// 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 clampAngle = 80.0f;