first version

esto y aquello y eso otro
This commit is contained in:
HamsterBalls
2016-05-07 22:50:54 -03:00
parent 4075508375
commit b3c5035547
141 changed files with 627 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
using UnityEngine;
using System.Collections;
public class cameraController : MonoBehaviour {
public GameObject player;
//so we reference the player on the inspector
private Vector3 offset;
//so we can calculate distance between player and camera
void Start ()
{
offset = transform.position - player.transform.position;
}
void LateUpdate ()
//on lateUpdate because here goes the animation thingies ¿?
{
transform.position = player.transform.position + offset;
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 68d9a363b9e46f84c97031449bea4bd7
timeCreated: 1462651325
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,24 @@
using UnityEngine;
using System.Collections;
public class playerController : MonoBehaviour {
public float speed;
private Rigidbody rb;
void Start ()
{
rb = GetComponent<Rigidbody>();
}
void FixedUpdate ()
{
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
rb.AddForce (movement * speed);
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 839806aa7263f3d4ab4de845712585bd
timeCreated: 1462649784
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: