骑士插图,UI调整
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user