Синтаксис:
Используется csharp
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.EventSystems;
public class ButtonMove : MonoBehaviour {
[SerializeField] private GameObject gg;
void OnGUI(){
if (GUI.Button (new Rect (16, 845, 100, 100), "<-")) {
gg.transform.Rotate (0, -90 , 0);
}
if (GUI.Button (new Rect (266, 845, 100, 100), "->")) {
gg.transform.Rotate (0, 90, 0);
}
}
}
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.EventSystems;
public class ButtonMove : MonoBehaviour {
[SerializeField] private GameObject gg;
void OnGUI(){
if (GUI.Button (new Rect (16, 845, 100, 100), "<-")) {
gg.transform.Rotate (0, -90 , 0);
}
if (GUI.Button (new Rect (266, 845, 100, 100), "->")) {
gg.transform.Rotate (0, 90, 0);
}
}
}
https://ibb.co/kQpYLpx
https://ibb.co/D1PyZ9N