Created
February 7, 2013 01:09
-
-
Save kovek/4727516 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class Character : MonoBehaviour { | |
private float speed = 0.2F; | |
private Texture[] buffer = new Texture[2]; | |
private Texture image; | |
void Start () { | |
image = Resources.Load("sprite_sheet") as Texture; | |
Debug.Log ("Is null?" + (image==null)); | |
GUI.DrawTextureWithTexCoords(new Rect(0, 0, 100, 100), image, new Rect(0f, 0f, 0.333f, 0.333f), true); | |
} | |
void Update () { | |
} | |
public void move(KeyCode direction){ | |
Debug.Log("received a click"); | |
float blocks = 0.0f; | |
if(direction == KeyCode.RightArrow){ | |
blocks = speed; | |
} | |
if(direction == KeyCode.LeftArrow){ | |
blocks = -speed; | |
} | |
mover.Move(blocks, 0, this); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment