basist, спс, сделал кнопку, но она не вызывает функцию почему-то.
На C#
Код
using UnityEngine;
using System.Collections;
public class controlcar : MonoBehaviour {
public bool go_left = false;
public bool go_right = false;
void Start () {
}
public void GoFunc()
{
go_left = true;
}
public void GoFunc2()
{
go_right = true;
}
void Update () {
if(Input.GetKey(KeyCode.A))
{
go_left = true;
}
else if (Input.GetKey(KeyCode.D))
{
go_right = true;
}
else
{
go_left = false;
go_right = false;
}
if (go_left == true)
{
Debug.Log("left")
}
if (go_right == true)
{
Debug.Log("right")
}
}
}
Добавлено (27 сентября 2015, 19:04)
---------------------------------------------
Помогите!