Exemplo n.º 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);
    }
Exemplo n.º 2
0
    // 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();
    }
Exemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     playerState = PlayerState._instance;
     bagManager = transform.parent.GetComponent<UIBagManager>();
     ItemInfoBG = transform.Find("ItemInfoBG").gameObject;
     equepSprite = ItemInfoBG.transform.Find("Item").Find("Sprite").GetComponent<UISprite>();
     STRLabel = ItemInfoBG.transform.Find("LabelSTRInfo").GetComponent<UILabel>();
     INTLabel = ItemInfoBG.transform.Find("LabelINTInfo").GetComponent<UILabel>();
     DEXLabel = ItemInfoBG.transform.Find("LabelDEXInfo").GetComponent<UILabel>();
     CONLabel = ItemInfoBG.transform.Find("LabelCONInfo").GetComponent<UILabel>();
     LUKLabel = ItemInfoBG.transform.Find("LabelLUKInfo").GetComponent<UILabel>();
     NameLabel = ItemInfoBG.transform.Find("LabelName").GetComponent<UILabel>();
     DescripteLabel = ItemInfoBG.transform.Find("LabelDescript").GetComponent<UILabel>();
     EquepDownButton = ItemInfoBG.transform.Find("EquepDownButton").gameObject;
     EquepUpButton = ItemInfoBG.transform.Find("EquepUpButton").gameObject;
     UseButton = ItemInfoBG.transform.Find("UseButton").gameObject;
     SellButton = ItemInfoBG.transform.Find("SellButton").gameObject;
     BuyButton = ItemInfoBG.transform.Find("BuyButton").gameObject;
     ConstLabels = ItemInfoBG.transform.Find("ConstLabels").gameObject;
     MoneyIcon = ItemInfoBG.transform.Find("MoneyIcon").gameObject;
     MoneyLabel = MoneyIcon.transform.Find("MoneyLabel").GetComponent<UILabel>();
 }
Exemplo n.º 4
0
 private void Awake()
 {
     Instance = this;
 }