private void Awake() { ChatFuncs.LoadDialogs(Globals.currentDialog); }
// Use this for initialization void Start() { //Load Head(Image,name,energy,exp) string headImagePath = "HeadImage/" + Globals.player.headImagePath; string name = Globals.player.nickname; int energy = Globals.player.energy; int maxEnergy = Globals.player.maxEnergy; int exp = Globals.player.exp; int maxExp = Globals.player.maxExp; characterId = Globals.player.characterId; //Find UIs //Head headMenu = GameFuncs.FindHiden("headMenuParent"); changeName = GameFuncs.FindHiden("changeNameParent"); changeSex = GameFuncs.FindHiden("changeSexParent"); changeHeadImage = GameFuncs.FindHiden("changeHeadImageParent"); Image headImage = UIManager.GetImage("headImage"); Text energyText = UIManager.GetText("energyText"); Text expText = UIManager.GetText("expText"); Slider energySlider = UIManager.GetSlider("energySlider"); Slider expSlider = UIManager.GetSlider("expSlider"); Text nameText = UIManager.GetText("nameText"); Button headImageBtn = UIManager.GetButton("headImageBtn"); //Character Button character = UIManager.GetButton("character"); //Items Text goldText = UIManager.GetText("goldText"); Text diaText = UIManager.GetText("diaText"); //Menus Button battleBtn = UIManager.GetButton("battleBtn"); Button heroesBtn = UIManager.GetButton("heroesBtn"); Button roomBtn = UIManager.GetButton("roomBtn"); Button summonBtn = UIManager.GetButton("summonBtn"); Button packBtn = UIManager.GetButton("packBtn"); Button settingBtn = UIManager.GetButton("settingBtn"); //ChatWindow chatWindow = GameFuncs.FindHiden("chatWindowParent"); //UIs'value //Head UIManager.ChangeImage("headImage", headImagePath); energyText.text = energy.ToString() + "/" + maxEnergy; expText.text = exp.ToString() + "/" + maxExp; energySlider.value = (float)energy / maxEnergy; expSlider.value = (float)exp / maxExp; nameText.text = name; //Items goldText.text = Globals.player.gold.ToString(); diaText.text = Globals.player.dia.ToString(); //Load Hero(Image,Dialog) string characterPath = "Character/Image/" + characterId + "_001"; UIManager.ChangeImage("character", characterPath); string dialogPath = characterId + "_click"; ChatFuncs.LoadDialogs(dialogPath); //Bind Buttons headImageBtn.onClick.AddListener(OnheadImageBtnClick); battleBtn.onClick.AddListener(OnbattleBtnClick); heroesBtn.onClick.AddListener(OnheroesBtnClick); roomBtn.onClick.AddListener(OnroomBtnClick); summonBtn.onClick.AddListener(OnsummonBtnClick); packBtn.onClick.AddListener(OnpackBtnClick); settingBtn.onClick.AddListener(OnsettingBtnClick); character.onClick.AddListener(OncharacterBtnClick); //Play BGM MusicManager.SetVolume(); MusicManager.PlayBgm("main"); }