コード例 #1
0
    // Use this for initialization
    void Start()
    {
        _instance = this;
        isShowPanel = false;
        npcManager =NPCManager._instance;
        NPCDictionary = npcManager.GetNPCDctionary();
        playerState = PlayerState._instance;
        mainControllerUI = UIController._instance;

        foreach (KeyValuePair<int, GameObject> item in NPCDictionary)
        {
            item.Value.GetComponent<NPCInfomation>().CommunicationStart += CommunicationTalk;
        }

        #region UI
        containItems = transform.Find("TalkContainer").Find("Scroll View").Find("Items").gameObject;


        talkLabel = containItems.transform.Find("TalkLabel").GetComponent<UILabel>();
        shopButton = containItems.transform.Find("ShopButton").GetComponent<UIButton>();
        questButton = containItems.transform.Find("QuestButton").GetComponent<UIButton>();
        bagManagerUI = GameObject.FindGameObjectWithTag(Tags.UIRoot).transform.Find("EquepMenu").GetComponent<UIBagManager>();
        npcQuestManagerUI = GameObject.FindGameObjectWithTag(Tags.UIRoot).transform.Find("NPCQuestPanel").GetComponent<UINPCQuestManager>();
        #endregion

        gameObject.SetActive(false);
    }
コード例 #2
0
ファイル: UIController.cs プロジェクト: tsss-t/SimpleStory
    // 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();
    }
コード例 #3
0
 // Use this for initialization
 void Start()
 {
     npcQuestManagerUI = GameObject.FindGameObjectWithTag(Tags.UIRoot).transform.Find("NPCQuestPanel").GetComponent<UINPCQuestManager>();
 }