public override void OnInit()
    {
        base.OnInit();

        m_SpriteMyIcon    = FindChildComponent <UISprite>("Sprite_Icon0");
        m_SpriteOtherIcon = FindChildComponent <UISprite>("Sprite_Icon1");
        m_ObjButtonRoot   = FindChild("ButtonRoot");
        m_ObjButtonOk     = FindChild("Button_Ok");
        m_ObjButtonCancle = FindChild("Button_Cancle");
        m_LabelMyName     = FindChildComponent <UILabel>("Label_Name1");
        m_LabelOtherName  = FindChildComponent <UILabel>("Label_Name2");

        m_ButtonTalk = FindChild("Button_Talk");
        UIEventListener.Get(m_ButtonTalk).onPress      = OnPressButton;
        UIEventListener.Get(m_ObjButtonOk).onClick     = OnClickAccept;
        UIEventListener.Get(m_ObjButtonCancle).onClick = OnClickRefuse;

        AddChildElementClickEvent(OnClickBack, "Sprite_Exit");

        m_DropPanel        = FindChildComponent <UIWidget>("DrapPanel");
        m_FireworkPlanList = new List <FireworkPlanElement>();
        for (int i = 0; i < 7; ++i)
        {
            var objRoot = FindChild("Type_" + i);
            FireworkPlanElement elem = new FireworkPlanElement(objRoot);
            elem.SetStatus(true, ItemManager.Instance.IsExistItem(i));
            m_FireworkPlanList.Add(elem);
            MyUIDragDropItem drag = objRoot.GetComponent <MyUIDragDropItem>();
            drag.RegisterDragEndAction(OnDragEnd);
            //UIEventListener.Get(objRoot).onClick = OnClickItem;;
        }

        m_ObjButtonRoot.SetActive(false);
        m_SpriteMyIcon.gameObject.SetActive(false);
        m_SpriteOtherIcon.gameObject.SetActive(false);
        m_ButtonTalk.SetActive(false);
        m_LabelOtherName.text = string.Empty;
        m_LabelMyName.text    = PlayerManager.Instance.GetCharBaseData().CharName;
    }
Example #2
0
    public override void OnInit()
    {
        base.OnInit();
        m_ObjBlock           = FindChild("Texture_Block");
        m_ObjFWPlanHighLight = FindChild("Sprite_HighlightfwPlan");
        m_ObjMicHighLight    = FindChild("Sprite_HighlightMic");
        m_ObjIcon0HighLight  = FindChild("Sprite_HighlightIcon0");
        m_ObjIcon1HighLight  = FindChild("Sprite_HighlightIcon1");
        m_ObjItem0HighLight  = FindChild("Sprite_HighlightItem0");
        m_ObjItem1HighLight  = FindChild("Sprite_HighlightItem1");
        m_ObjExitHighLight   = FindChild("Sprite_HighlightExit");

        m_ObjButtonOk     = FindChild("Button_Ok");
        m_ObjButtonCancle = FindChild("Button_Cancle");
        m_LabelName1      = FindChildComponent <UILabel>("Label_Name1");
        m_LabelName2      = FindChildComponent <UILabel>("Label_Name2");
        m_SpriteIcon1     = FindChildComponent <UISprite>("Sprite_Icon0");
        m_SpriteIcon2     = FindChildComponent <UISprite>("Sprite_Icon1");
        AddChildElementClickEvent(OnExit, "Sprite_Exit");
        m_ObjGuideHandRoot = FindChild("Texture_GuideHand");

        var obj = FindChild("Button_Talk");

        UIEventListener.Get(obj).onPress = OnPressButton;

        m_DropPanel        = FindChildComponent <UIWidget>("DrapPanel");
        m_FireworkPlanList = new List <FireworkPlanElement>();
        for (int i = 0; i < 7; ++i)
        {
            var objRoot = FindChild("Type_" + i);
            FireworkPlanElement elem = new FireworkPlanElement(objRoot);
            if (i == 0)
            {
                m_Item0Collider = objRoot.GetComponent <BoxCollider>();
            }
            else if (i == 1)
            {
                m_Item1Collider = objRoot.GetComponent <BoxCollider>();
            }
            elem.SetStatus(true, i < 3);
            m_FireworkPlanList.Add(elem);
            MyUIDragDropItem drag = objRoot.GetComponent <MyUIDragDropItem>();
            drag.RegisterDragEndAction(OnDragEnd);
        }
        SetButtonStatus(false, true);
        m_SpriteIcon1.gameObject.SetActive(false);
        //m_SpriteIcon2.gameObject.SetActive(false);
        //m_LabelName2.text = string.Empty;
        m_LabelName1.text = PlayerManager.Instance.GetCharBaseData().CharName;
        SetFWPHighlightStatus(false);
        SetMicHighlightStatus(false);
        SetIcon0HighlightStatus(false);
        SetIcon1HighlightStatus(false);
        SetExitHighLightStatus(false);
        SetItem0HighLightStatus(false);
        SetItem1HighLightStatus(false);
        SetItem0Dragable(false);
        SetItem1Dragable(false);

        m_SpriteList = new List <GameObject>();
        for (int i = 0; i < 2; ++i)
        {
            m_SpriteList.Add(FindChild("Frame" + i));
        }
        m_ObjGuideHandRoot.SetActive(false);
    }