Beispiel #1
0
    Image huXingBG;    //户型的背景图片

    // Use this for initialization
    void Start()
    {
        //获取到用户选择场景的各个控件
        selectHuXingBtn = GameObject.Find("Canvas3D/Background/Shadow/Image").GetComponent <Button>();
        HuXingSelectBtn = GameObject.Find(UIFilePath.HuXingScenceTop + "NtnSelect").GetComponent <Button>(); //获取户型选择Button
        huXingName      = GameObject.Find(UIFilePath.HuXingScenceTitle + "Text").GetComponent <Text>();      //获取户型名称文本Text

        insertBtn     = GameObject.Find(UIFilePath.HuXingScenceRight + "BtnGo").GetComponent <Button>();     //获取进入家具装修场景Button
        backLouPanBtn = GameObject.Find(UIFilePath.HuXingScenceTop + "NtnBack").GetComponent <Button>();     //获取返回楼盘Button

        //给户型选择场景的各个控件添加相应的事件
        EventTriggerListener.GetEventTriggerListener(insertBtn.gameObject).PointerDown     = ClickGo;    //点击转到家具装饰场景
        EventTriggerListener.GetEventTriggerListener(backLouPanBtn.gameObject).PointerDown = BackLouPan; //点击返回到楼盘选择界面
    }
Beispiel #2
0
    GameObject selectFurnituresI;    //选择家具界面

    // Use this for initialization
    void Start()
    {
        /// <summary>
        ///获取UI界面控件
        /// </summary>
        btnChangeStyle = GameObject.Find(UIFilePath.FurnitureScenceBtnChangeStyle).GetComponent <Button>(); //获取更换风格Button
        btnDIYStyle    = GameObject.Find(UIFilePath.FurnitureScenceBtnDIYStyle).GetComponent <Button>();    //获取个人定制Button
        btnBackBuilds  = GameObject.Find(UIFilePath.FurnitureScenceBtnBackBuilds).GetComponent <Button>();  //获取返回楼盘Button
        btnBackMenu    = GameObject.Find(UIFilePath.FurnitureScenceBackMainUI).GetComponent <Button>();     //获取返回主界面Button


        btnViewer    = GameObject.Find(UIFilePath.FurnitureScenceBackground + "BtnViewer").GetComponent <Button>();    //获取视觉选择Button
        btnFurniture = GameObject.Find(UIFilePath.FurnitureScenceBackground + "BtnFurniture").GetComponent <Button>(); //获取添加家具Button
        btnTexture   = GameObject.Find(UIFilePath.FurnitureScenceBackground + "BtnTexture").GetComponent <Button>();   //获取颜色和纹理Button

        //个人定制界面三个折合按钮btnFold的获取
        btnFold1 = GameObject.Find(UIFilePath.FurnitureScenceFurniturePanelDIY + "Option1/BtnFold").GetComponent <Button>();
        btnFold2 = GameObject.Find(UIFilePath.FurnitureScenceFurniturePanelDIY + "Option2/BtnFold").GetComponent <Button>();
        btnFold3 = GameObject.Find(UIFilePath.FurnitureScenceFurniturePanelDIY + "Option3/BtnFold").GetComponent <Button>();


        viewerPanel     = GameObject.Find(UIFilePath.FurnitureScenceBackground + "ViewerPanel"); //获取视觉选择界面
        furniturerPanel = GameObject.Find(UIFilePath.FurnitureScenceFurniturerPanel);            //获取家具选择界面
        textuesPanel    = GameObject.Find(UIFilePath.FurnitureScenceTextuesPanel);               //获取颜色和纹理选择界面
        panelDIY        = GameObject.Find(UIFilePath.FurnitureScenceFurniturePanelDIY);          //获取个人定制界面

        //获取个人定制界面折合按钮点击后对应的弹出窗口
        option1List = GameObject.Find(UIFilePath.FurnitureScenceFurniturePanelDIY + "Option1/OptionList");
        option2List = GameObject.Find(UIFilePath.FurnitureScenceFurniturePanelDIY + "Option2/OptionList");
        optionPanel = GameObject.Find(UIFilePath.FurnitureScenceFurniturePanelDIY + "Option3/OptionPanel");

        btnClosed         = GameObject.Find(UIFilePath.FurnitureScenceSelectFurniture).GetComponent <Button>(); //获取选择家具窗口关闭Button
        selectFurnituresI = GameObject.Find(UIFilePath.FurnitureScenceBackground + "SelectFurniture");          //获取选择家具界面

        //隐藏要显示的界面(通过事件点击)
        viewerPanel.SetActive(false);
        furniturerPanel.SetActive(false);
        textuesPanel.SetActive(false);
        panelDIY.SetActive(false);

        option1List.SetActive(false);
        option2List.SetActive(false);
        optionPanel.SetActive(false);

        /// <summary>
        ///添加相应的事件
        /// </summary>
        EventTriggerListener.GetEventTriggerListener(btnBackBuilds.gameObject).PointerDown = BackLouPanUI;        //给返回楼盘按钮添加事件
        EventTriggerListener.GetEventTriggerListener(btnBackMenu.gameObject).PointerDown   = BackMainMenuUI;      //给返回主菜单按钮添加事件

        EventTriggerListener.GetEventTriggerListener(btnViewer.gameObject).PointerDown    = SelectOfViewer;       //视觉选择按钮添加事件
        EventTriggerListener.GetEventTriggerListener(btnFurniture.gameObject).PointerDown = FurnitureOfAdd;       //家具按钮添加事件
        EventTriggerListener.GetEventTriggerListener(btnTexture.gameObject).PointerDown   = ColorsAndTexOfSelect; //颜色和纹理添加事件

        //给个人定制和更换风格Button分别添加事件
        EventTriggerListener.GetEventTriggerListener(btnDIYStyle.gameObject).PointerDown = DIY;

        //给个人定制界面折合按钮添加事件
        EventTriggerListener.GetEventTriggerListener(btnFold1.gameObject).PointerDown = BtnFold1IsPressed;
        EventTriggerListener.GetEventTriggerListener(btnFold2.gameObject).PointerDown = BtnFold2IsPressed;
        EventTriggerListener.GetEventTriggerListener(btnFold3.gameObject).PointerDown = BtnFold3IsPressed;

        //给家具选择界面关闭Button添加事件
        EventTriggerListener.GetEventTriggerListener(btnClosed.gameObject).PointerDown = CloseWindow;
    }