mirror of
https://github.com/ConjureETS/OuijaMTLGJ2016.git
synced 2026-03-24 10:11:07 +00:00
34 lines
707 B
C#
34 lines
707 B
C#
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
public class PlayerControllerSR : MonoBehaviour {
|
|
|
|
private Rigidbody rb;
|
|
|
|
// Use this for initialization
|
|
void Start () {
|
|
rb = GetComponent<Rigidbody>();
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update () {
|
|
}
|
|
|
|
void FixedUpdate()
|
|
{
|
|
if (Input.GetKey(KeyCode.A))
|
|
rb.AddForce(-transform.right * 5);
|
|
if (Input.GetKey(KeyCode.D))
|
|
rb.AddForce(transform.right * 5);
|
|
if (Input.GetKey(KeyCode.S))
|
|
rb.AddForce(transform.forward * 5);
|
|
if (Input.GetKey(KeyCode.W))
|
|
rb.AddForce(-transform.forward * 5);
|
|
}
|
|
|
|
void OnTriggerEnter(Collider col)
|
|
{
|
|
Debug.Log(col.gameObject.GetComponent<RuneBehaviour>().letterNum);
|
|
}
|
|
}
|