public void ButtonNextClicked()
{
SelectIndex++;
SelectIndex %= ;
showGameObject();
}
public void ButtonPreClicked()
{
SelectIndex--;
if (SelectIndex < )
SelectIndex += ;
showGameObject();
}
public void ButtonOkClicked()
{
PlayerPrefs.SetInt("CharacterSelectIndex", SelectIndex);
PlayerPrefs.SetString("PlayerName", NameInput.value);
这段代码是attach在一个空的GameObject上,注意是public
,另外在按钮的UIButton上挂载函数的时候记得得先挂载对象(GameObject)
最后,放一张已经完成的UI界面,哈哈,美不美