I’m generally new to Unity and I’m trying to build a 2d turn based strategy game for android. I’m trying to learn how to use touchscript and for some reason, my print statement doesn’t show up until after the program is done running? It doesn’t seem like anything is happening when I click on the object in game, but those messages show at the end. Any ideas?
using UnityEngine;
using System.Collections;
using TouchScript.Gestures;
public class Test : MonoBehaviour {
public GameObject target;
public bool test = false;
public string message;
// Use this for initialization
void Start ()
{
GetComponent().StateChanged += HandleStateChanged;
}
// Update is called once per frame
void Update ()
{
if (test == true) {
target.transform.Translate (0, 0, 0);
}
}
private void HandleStateChanged(object sender, TouchScript.Events.GestureStateChangeEventArgs e)
{
if (e.State == Gesture.GestureState.Recognized) {
target = GameObject.FindWithTag (“CurrentObject”);
test = true;
}
// can anyone explain to me why this doesn’t show up until after the program is done running?
print (“You clicked me”);
}
}