private void Awake() { if (Instance == null) { Instance = this; } else { Debug.LogError("More Than two instance"); } uiSkillManager = GameObject.Find("UISkillManager").GetComponent <UISkillManager>(); }
// Use this for initialization void Start() { player = GameObject.FindGameObjectWithTag(Tags.player).GetComponent<PlayerController>(); playerState = PlayerState._instance; isToolbarShow = true; containerToolBar = transform.Find("ToolBar"); containerPlayerState = transform.Find("PlayerState"); containerMap = transform.Find("GameMap"); containerEquepMenu = transform.Find("EquepMenu"); containerSkill = transform.Find("SkillContainer"); spriteAllow = containerMap.Find("miniMap/spriteAllow"); portalButton = transform.Find("PortalButton").gameObject; toolBarChangeButton = transform.Find("ToolBarChangeButton").GetComponent<UIButton>(); sliderEnergy = containerPlayerState.Find("sliderEnergy").GetComponent<UISlider>(); labelEnergy = sliderEnergy.gameObject.transform.Find("labelEnergy").GetComponent<UILabel>(); sliderHP = containerPlayerState.Find("sliderHP").GetComponent<UISlider>(); sliderExp = containerToolBar.Find("ExpBar").GetComponent<UISlider>(); labelHP = sliderHP.transform.Find("labelHP").GetComponent<UILabel>(); labelLevel = containerPlayerState.Find("labelLevel").GetComponent<UILabel>(); labelLog = containerToolBar.Find("Menu/LogPanel/Scroll View/LogLabel").GetComponent<UILabel>(); playerState.OnPlayerStateChanged += OnStateChanged; playerState.OnPlayerGetItem += OnGetNewItem; if (PortalManager._instance != null) { PortalManager._instance.playerStateChange += InOutPortal; } bagManagerUI = containerEquepMenu.GetComponent<UIBagManager>(); questManagerUI = transform.Find("QuestMenu").GetComponent<UIQuestManager>(); npcQuestManagerUI = transform.Find("NPCQuestPanel").GetComponent<UINPCQuestManager>(); communicationPanelUI = transform.Find("CommunicationPanel").GetComponent<UICommunicationManager>(); skillManagerUI = transform.Find("SkillPanel").GetComponent<UISkillManager>(); portalManagerUI = transform.Find("PortalPanel").GetComponent<UIPortalManager>(); portalButton.SetActive(false); ToolBarInit(); }
private void Awake() { Instance = this; }