public static UIQuestManager Instance() { lock (padlock) { if(singleton == null) singleton = new UIQuestManager(); }; return singleton; }
// 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(); }
// Use this for initialization void Start() { questManager = GameObject.FindGameObjectWithTag(Tags.UIRoot).transform.Find("QuestMenu").GetComponent<UIQuestManager>(); PlayerState._instance.GetPlayerQuest().GetAcceptQuestList().TryGetValue(int.Parse(transform.parent.name), out quest); }
public void Start() { if (singleton == null) singleton = this; else { if(singleton != this) DestroyImmediate (this); } DontDestroyOnLoad (this); }