37 lines
792 B
C#
37 lines
792 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace AnimatorPlus.Example
|
|
{
|
|
public class ExampleUI_CharacterContol : MonoBehaviour
|
|
{
|
|
public Button Button1;
|
|
public Button Button2;
|
|
|
|
public GameObject Character1;
|
|
public GameObject Character2;
|
|
|
|
public void Start()
|
|
{
|
|
Button1.onClick.AddListener(Button1Click);
|
|
Button2.onClick.AddListener(Button2Click);
|
|
}
|
|
|
|
void Button1Click()
|
|
{
|
|
Character1.SetActive(true);
|
|
Character1.transform.position = Vector3.zero;
|
|
|
|
Character2.SetActive(false);
|
|
}
|
|
|
|
void Button2Click()
|
|
{
|
|
Character2.SetActive(true);
|
|
Character2.transform.position = Vector3.zero;
|
|
|
|
Character1.SetActive(false);
|
|
}
|
|
}
|
|
}
|