Exemple #1
0
    public RenderImage(GGraph holder)
    {
        _width        = Mathf.RoundToInt(holder.width * GRoot.contentScaleFactor);
        _height       = Mathf.RoundToInt(holder.height * GRoot.contentScaleFactor);
        _cacheTexture = true;

        this._image = new Image();
        holder.SetNativeObject(this._image);

        if (_camera == null)
        {
            CreateCamera();
        }

        this._root = new GameObject("render_image" + _gid++).transform;
        Object.DontDestroyOnLoad(this._root.gameObject);
        this._root.SetParent(_camera.transform, false);
        SetLayer(this._root.gameObject, "Hidden");

        this._modelRoot = new GameObject("model_root").transform;
        Object.DontDestroyOnLoad(this._modelRoot.gameObject);
        this._modelRoot.SetParent(this._root, false);

        this._background = new GameObject("background").transform;
        Object.DontDestroyOnLoad(this._background.gameObject);
        this._background.SetParent(this._root, false);

        this._image.onAddedToStage.Add(OnAddedToStage);
        this._image.onRemovedFromStage.Add(OnRemoveFromStage);

        if (this._image.stage != null)
        {
            OnAddedToStage();
        }
    }
Exemple #2
0
        public override void ConstructFromXML()
        {
            this.Owner = "FUI.Login";

            m_Video_Ani = (GGraph)this.GetChild("Video_Ani");
            m_Video_Org = (GGraph)this.GetChild("Video_Org");
        }
Exemple #3
0
    public void Stage(GComponent stage, bool draw = false)
    {
        isDraw             = draw;
        userModel          = ModelManager.inst.userModel;
        this.stage         = stage;
        this.stage.visible = false;
//		if (Convert.ToInt32 (userModel.records ["guide"]) == 2)
//			return;
        view = Tools.GetComponent(Config.COM_GUIDE).asCom;
        this.stage.AddChild(view);

        mask = view.GetChild("n0").asGraph;
        ViewManager.SetWidthHeight(mask);
        text    = view.GetChild("n3").asTextField;
        content = view.GetChild("n1").asGroup;
        btn1    = view.GetChild("n5").asButton;
        add     = new GComponent();
        view.GetChild("n2").asGraph.ReplaceMe(add);
        btn1.onClick.Add(() =>
        {
            Clear();
            DispatchManager.inst.Dispatch(new MainEvent(MainEvent.GUIDE_UPDATE_OK, null));
//			SetGuild(4);
//			this.guide11++;
//			this.guide12 = 0;
//			this.stage.visible = false;
        });
        mask.onClick.Add(Mask_Click);
        this.guide11 = 0;
        this.guide12 = 0;
        if (isDraw)
        {
            mask.visible = false;
        }
    }
Exemple #4
0
        public void Awake(GObject go)
        {
            if (go == null)
            {
                return;
            }

            GObject = go;

            if (string.IsNullOrWhiteSpace(Name))
            {
                Name = Id.ToString();
            }

            self = (GButton)go;

            self.Add(this);

            var com = go.asCom;

            if (com != null)
            {
                m_button = com.GetControllerAt(0);
                m_n0     = (GGraph)com.GetChildAt(0);
                m_n1     = (GGraph)com.GetChildAt(1);
                m_n2     = (GGraph)com.GetChildAt(2);
            }
        }
        public override void ConstructFromXML(XML xml)
        {
            base.ConstructFromXML(xml);

            m_back = (GGraph)this.GetChildAt(0);
            Init();
        }
Exemple #6
0
        private void InitView()
        {
            GRoot.inst.SetContentScaleFactor(1920, 1080);
#if UNITY_EDITOR
            UIPackage.AddPackage("Load/HotFixLoading/HotFixLoading");
#endif
            GComponent view = UIPackage.CreateObject(_packageName, _pageName).asCom;
            GRoot.inst.AddChild(view);
            view.MakeFullScreen();
            _view          = view;
            _frame         = _view.GetChild("frame").asCom;
            _frame.visible = false;
            _apkDes        = _frame.GetChild("context").asCom.GetChild("text").asTextField;
            _confirmBtn    = _frame.GetChild("confirmBtn").asButton;
            _loadingAni    = _frame.GetTransition("loadingAni");

            _progress       = _view.GetChild("loading").asProgress;
            _progress.value = 0;
            _loading        = _view.GetChild("loadingSpine").asGraph;

            Object     obj       = Resources.Load("Load/Prefab/LoadSpine");
            GameObject spineItem = Instantiate(obj) as GameObject;
            float      scaleX    = GRoot.inst.width / DESIGN_WIDTH;
            float      scaleY    = GRoot.inst.height / DESIGN_HEIGHT;
            spineItem.transform.localScale = new Vector3(scaleX, scaleY, 1);
            GoWrapper         wrapper = new GoWrapper(spineItem);
            SkeletonAnimation spine   = spineItem.gameObject.GetComponent <SkeletonAnimation>();
            spine.state.SetAnimation(0, "H5_loading", true);
            _loading.SetNativeObject(wrapper);

            _text      = _view.GetChild("textInfo").asTextField;
            _text.text = "正在检测版本更新...";

            _confirmBtn.onClick.Add(onClick);
        }
Exemple #7
0
        public void Awake(GObject go)
        {
            if (go == null)
            {
                return;
            }

            GObject = go;

            if (string.IsNullOrWhiteSpace(Name))
            {
                Name = Id.ToString();
            }

            self = (GComponent)go;

            self.Add(this);

            var com = go.asCom;

            if (com != null)
            {
                focus = (GGraph)com.GetChildAt(1);
            }
        }
Exemple #8
0
        public void Awake(GObject go)
        {
            if (go == null)
            {
                return;
            }

            GObject = go;

            if (string.IsNullOrWhiteSpace(Name))
            {
                Name = Id.ToString();
            }

            self = (GComponent)go;

            self.Add(this);

            var com = go.asCom;

            if (com != null)
            {
                account      = (GTextInput)com.GetChildAt(4);
                password     = (GTextInput)com.GetChildAt(5);
                loginBtn     = (GButton)com.GetChildAt(6);
                selserverBtn = (GButton)com.GetChildAt(7);
                storyBtn     = (GButton)com.GetChildAt(8);
                newGuideBtn  = (GButton)com.GetChildAt(9);
                hold         = (GGraph)com.GetChildAt(10);
            }
        }
    public JoystickModule(GComponent mainView)
    {
        onMove = new EventListener(this, "onMove");
        onEnd  = new EventListener(this, "onEnd");

        _button = mainView.GetChild("joystick").asButton;
        _button.changeStateOnClick = false;
        _thumb     = _button.GetChild("thumb");
        _touchArea = mainView.GetChild("joystick_touch").asGraph;
        if (is_show_touch_rect)
        {
            _touchArea.DrawRect(_touchArea.width, _touchArea.height, 1, Color.gray, Color.clear);
        }
        _center        = mainView.GetChild("joystick_center");
        _frame         = mainView.GetChild("joystick_frame").asCom;
        _frame.visible = false;
        //GComponent frameView = UIPackage.CreateObject("Joystick", "frame").asCom;
        _frame_ctrler = _frame.GetController("button");

        _InitX       = _center.x + _center.width / 2;
        _InitY       = _center.y + _center.height / 2;
        touchId      = -1;
        radius       = 60;
        frame_radius = 106;
        locomotion   = Player.Locomotion.Idle;

        can_frame_touch = true;
        _touchArea.onTouchBegin.Add(this.onTouchDown);
    }
        public void Awake(GObject go)
        {
            if (go == null)
            {
                return;
            }

            GObject = go;

            if (string.IsNullOrWhiteSpace(Name))
            {
                Name = Id.ToString();
            }

            self = (GProgressBar)go;

            self.Add(this);

            var com = go.asCom;

            if (com != null)
            {
                n0  = (GGraph)com.GetChildAt(0);
                bar = (GImage)com.GetChildAt(1);
            }
        }
Exemple #11
0
    public RenderImage(GGraph holder)
    {
        _width        = (int)holder.width;
        _height       = (int)holder.height;
        _cacheTexture = true;

        this._image = new Image();
        holder.SetNativeObject(this._image);

        if (_camera == null)
        {
            CreateCamera();
        }

        this._root = new GameObject("render_image" + _gid++).transform;
        Object.DontDestroyOnLoad(this._root.gameObject);
        this._root.SetParent(_camera.transform, false);
        SetLayer(this._root.gameObject, HIDDEN_LAYER);

        this.modelRoot = new GameObject("model_root").transform;
        Object.DontDestroyOnLoad(this.modelRoot.gameObject);
        this.modelRoot.SetParent(this._root, false);

        this._background = new GameObject("background").transform;
        Object.DontDestroyOnLoad(this._background.gameObject);
        this._background.SetParent(this._root, false);

        this._image.onAddedToStage.Add(OnAddedToStage);
        this._image.onRemovedFromStage.Add(OnRemoveFromStage);

        if (this._image.stage != null)
        {
            OnAddedToStage();
        }
    }
Exemple #12
0
        public void Awake(GObject go)
        {
            if (go == null)
            {
                return;
            }

            GObject = go;

            if (string.IsNullOrWhiteSpace(Name))
            {
                Name = Id.ToString();
            }

            self = (GLabel)go;

            self.Add(this);

            var com = go.asCom;

            if (com != null)
            {
                n0          = (GImage)com.GetChildAt(0);
                title       = (GTextField)com.GetChildAt(1);
                icon        = (GLoader)com.GetChildAt(2);
                dragArea    = (GGraph)com.GetChildAt(3);
                contentArea = (GGraph)com.GetChildAt(4);
            }
        }
Exemple #13
0
        public override void ConstructFromXML(XML xml)
        {
            base.ConstructFromXML(xml);

            dragArea    = (GGraph)this.GetChild("dragArea");
            closeButton = (GButton)this.GetChild("closeButton");
        }
Exemple #14
0
    // Use this for initialization
    void Start()
    {
        PlayerPrefs.DeleteAll();
        UIPackage.AddPackage("FairyGUI/UIMain");
        UIObjectFactory.SetPackageItemExtension("ui://UIMain/ClickShower", typeof(ShowClickMask));
        hasSave = PlayerPrefs.GetInt("hasSave", 0);

        _main_menu = GetComponent <UIPanel> ().ui;
        _main_menu.GetController("c0").SetSelectedPage("unsave");
        if (hasSave > 0)
        {
            _main_menu.GetController("c0").SetSelectedPage("save");
        }
        _main_menu.GetChild("loadGame").onClick.Add(loadGame);
        _main_menu.GetChild("newGame").onClick.Add(newGame);
        _main_menu.GetChild("options").onClick.Add(options);
        _main_menu.GetChild("quit").onClick.Add(quit);

        //_main_menu.onClick.Add (OnClick);
        _main_menu.onClick.Add(OnClickShow);
        effect = _main_menu.GetChild("effect").asMovieClip;
//		ShowClickMask _maskLayer = (ShowClickMask)UIPackage.CreateObject ("UIMain", "ClickShower").asCom;
//		_maskLayer.SetSize(GRoot.inst.width, GRoot.inst.height);
//		_maskLayer.AddRelation(GRoot.inst, RelationType.Size);
//
//
//
//		GRoot.inst.AddChild(_maskLayer);
//		_main_menu.AddChild (mask);
//		Debug.Log (_main_menu.numChildren);
//		Debug.Log (mask.position);

        _mask = _main_menu.GetChild("mask").asGraph;


        _newHeroPanel = _main_menu.GetChild("newHeroPanel").asCom;
        _info         = _newHeroPanel.GetChild("info").asTextField;
        _desp         = _newHeroPanel.GetChild("desp").asTextField;

        _start_game = _newHeroPanel.GetChild("startGame").asLoader;
        _start_game.onClick.Add(delegate(EventContext context) {
            PlayerData.getInstance().heroIdx = choosedHeroIdx;
            enterGame();
        });

        _hero_list = _newHeroPanel.GetChild("hero_list").asList;
        _hero_list.SetVirtualAndLoop();

        _hero_list.itemRenderer = RenderHeroes;
        _hero_list.numItems     = GameStaticData.getInstance().heroes.Count;
        _hero_list.scrollPane.onScroll.Add(doHeroScrollEffect);
        _hero_list.scrollPane.onScrollEnd.Add(changeHeroDetail);
        doHeroScrollEffect();
        changeHeroDetail();
        {
            _info.text = GameStaticData.getInstance().heroes[choosedHeroIdx].name;
            _desp.text = GameStaticData.getInstance().heroes [choosedHeroIdx].desp;
        }
    }
        public override void ConstructFromXML(XML xml)
        {
            base.ConstructFromXML(xml);

            m_bgGraph  = (GGraph)GetChildAt(0);
            m_loginTxt = (GTextField)GetChildAt(1);
            m_loginBtn = (GButton)GetChildAt(2);
        }
Exemple #16
0
        public override void ConstructFromXML(XML xml)
        {
            base.ConstructFromXML(xml);

            m_button = this.GetController("button");
            m_n23    = (GGraph)this.GetChild("n23");
            m_n22    = (GGraph)this.GetChild("n22");
        }
Exemple #17
0
        public override void ConstructFromXML(XML xml)
        {
            base.ConstructFromXML(xml);

            m_BarHp     = (GProgressBar)this.GetChildAt(0);
            m_Body      = (GGraph)this.GetChildAt(1);
            m_HurtStart = (GComponent)this.GetChildAt(2);
        }
 public override void OnBeforeEnter()
 {
     //获取游戏组件
     MiniMapCamera = GameObject.Find("MiniMapCamera").GetComponent <Camera>();
     if (!PlayerPrefs.HasKey("Sound"))
     {
         PlayerPrefs.SetInt("Sound", 1);
         SoundManager.Instance.Mute = false;
     }
     else
     {
         int mute = PlayerPrefs.GetInt("Sound");
         SoundManager.Instance.Mute = mute == 1 ? false : true;
     }
     //获取FairyGUI组件
     this.contentPane.MakeFullScreen();
     BagMenuButton    = this.contentPane.GetChild("BagButton").asButton;
     StatusMenuButton = this.contentPane.GetChild("StatusButton").asButton;
     EquipButton      = this.contentPane.GetChild("EquipButton").asButton;
     SkillButton      = this.contentPane.GetChild("SkillButton").asButton;
     SystemButton     = this.contentPane.GetChild("SettingButton").asButton;
     ShortCutList     = this.contentPane.GetChild("ShortCutList").asList;
     HpSlider         = this.contentPane.GetChild("HPSlider").asSlider;
     MpSlider         = this.contentPane.GetChild("MPSlider").asSlider;
     ExpSlider        = this.contentPane.GetChild("ExpSlider").asSlider;
     Name             = this.contentPane.GetChild("Name").asTextField;
     Lv                   = this.contentPane.GetChild("LV").asTextField;
     Face                 = this.contentPane.GetChild("Face").asGraph;
     MiniMap              = this.contentPane.GetChild("MiniMap").asGraph;
     MiniMapZoomInButton  = this.contentPane.GetChild("ZoomIn").asButton;
     MiniMapZoomOutButton = this.contentPane.GetChild("ZoomOut").asButton;
     Gameover             = this.contentPane.GetChild("GameOver").asGroup;
     QuitGameButton       = this.contentPane.GetChild("QuitGameButton").asButton;
     Mask                 = this.contentPane.GetChild("Mask").asGroup;
     //添加组件事件
     BagMenuButton.onClick.Add(() => { UIWindowManager.Instance.OpenWindow(UIWindowTypes.BagMenuWindow); });
     StatusMenuButton.onClick.Add(() => { UIWindowManager.Instance.OpenWindow(UIWindowTypes.StatusMenuWindow); });
     EquipButton.onClick.Add(() => { UIWindowManager.Instance.OpenWindow(UIWindowTypes.EquipMenuWindow); });
     SkillButton.onClick.Add(() => { UIWindowManager.Instance.OpenWindow(UIWindowTypes.SkillMenuWindow); });
     SystemButton.onClick.Add(() => { UIWindowManager.Instance.OpenWindow(UIWindowTypes.SystemMenuWindow); });
     MiniMapZoomInButton.onClick.Add(OnZoomInButtonDown);
     MiniMapZoomOutButton.onClick.Add(OnZoomOutButtonDown);
     QuitGameButton.onClick.Add(OnQuitGameButtonDown);
     //添加通知事件
     PlayerStatusManager.Instance.LvUP     += UpdateUI;
     PlayerStatusManager.Instance.UpdateUI += UpdateUI;
     PlayerStatusManager.Instance.Death    += PlayerDeath;
     //组件显示操作
     HpSlider.touchable  = false;
     MpSlider.touchable  = false;
     ExpSlider.touchable = false;
     Mask.visible        = false;
     Gameover.visible    = false;
     ShowFace();
     ShowMiniMap();
     ShortCutManager.Instance.SetShortCutToList(ShortCutList);
     UpdateUI();
 }
Exemple #19
0
        public override void ConstructFromXML(XML xml)
        {
            base.ConstructFromXML(xml);

            bg     = (GGraph)this.GetChildAt(0);
            role_1 = (UI_role_bar)this.GetChildAt(1);
            role_2 = (UI_role_bar)this.GetChildAt(2);
            line   = (GImage)this.GetChildAt(3);
        }
Exemple #20
0
 public override void Clear()
 {
     base.Clear();
     if (img_box != null)
     {
         img_box.Dispose();
     }
     img_box = null;
 }
    public GameObject AddShip(string id, GGraph parent, bool isAvatar = false)
    {
        GameObject go = Tools.GetPrefab(PATH_SHIP);

        go.GetComponent <ShipView> ().change(id, isAvatar);
        go.transform.localScale *= 140;
        parent.SetNativeObject(new GoWrapper(go));
        return(go);
    }
Exemple #22
0
    public override void ConstructFromXML(FairyGUI.Utils.XML xml)
    {
        base.ConstructFromXML(xml);
        _icon = this.GetChild("icon").asLoader;
        _name = this.GetChild("name").asTextField;

        _detail    = this.GetChild("detail").asTextField;
        _detail_bg = this.GetChild("detail_bg").asGraph;
    }
        public override void ConstructFromXML(XML xml)
        {
            base.ConstructFromXML(xml);

            m_Background = (GGraph)this.GetChildAt(0);
            m_Info       = (GTextField)this.GetChildAt(1);
            m_Confirm    = (GButton)this.GetChildAt(2);
            Init();
        }
Exemple #24
0
 public MenuView(GComponent view)
 {
     View = view;
     bg   = view.GetChild("bg").asGraph;
     menu = view.GetChild("menu").asGroup;
     bg.onClick.Add(OnBgClick);
     bg.onRightClick.Add(OnBgClick);
     calls.Clear();
 }
Exemple #25
0
        public override void ConstructFromXML(XML xml)
        {
            base.ConstructFromXML(xml);

            m_button = this.GetControllerAt(0);
            m_n0     = (GGraph)this.GetChildAt(0);
            m_n1     = (GGraph)this.GetChildAt(1);
            m_n2     = (GGraph)this.GetChildAt(2);
        }
Exemple #26
0
 public override void ConstructFromXML(FairyGUI.Utils.XML xml)
 {
     base.ConstructFromXML(xml);
     //this.onClick.Add (unequip);
     cIcon = this.GetChild("icon").asLoader;
     //this.onDrop.Add (replaceComponent);
     _detail    = this.GetChild("detail").asTextField;
     _detail_bg = this.GetChild("detail_bg").asGraph;
 }
Exemple #27
0
        public override void ConstructFromXML(XML xml)
        {
            base.ConstructFromXML(xml);

            m_n6          = (GImage)this.GetChild("n6");
            m_dragArea    = (GGraph)this.GetChild("dragArea");
            m_title       = (GTextField)this.GetChild("title");
            m_closeButton = (UI_CloseButton)this.GetChild("closeButton");
        }
Exemple #28
0
        public override void ConstructFromXML(XML xml)
        {
            base.ConstructFromXML(xml);

            m_Splash1 = (GGraph)this.GetChildAt(43);
            m_Splash2 = (GGraph)this.GetChildAt(44);
            m_t0      = this.GetTransitionAt(0);
            m_t1      = this.GetTransitionAt(1);
        }
Exemple #29
0
    public override void Init()
    {
        base.Init();
        this.Create(Config.COM_LOAD);

        gp = this.GetChild("n0").asGroup;
        gg = this.GetChild("n3").asGraph;
        EffectManager.inst.AddEffect(Config.EFFECT_LOADING, "icon_loading", gg, null, false, 50);
        gp.visible = false;
        TimerManager.inst.Add(2f, 1, Time_Tick);
    }
Exemple #30
0
        public override void ConstructFromXML(XML xml)
        {
            base.ConstructFromXML(xml);

            mbutton = this.GetController("button");
            mn0     = (GGraph)this.GetChild("n0");
            mn1     = (GGraph)this.GetChild("n1");
            mn2     = (GGraph)this.GetChild("n2");
            mtitle  = (GTextField)this.GetChild("title");
            micon   = (GLoader)this.GetChild("icon");
        }