示例#1
0
    // 播放动画
    public void PlayStageAnimation(ENSTAGE stage)
    {
        string animationName = "";

        switch (stage)
        {
        case ENSTAGE.enStage1:
            animationName = "ui-summary-00";
            break;

        case ENSTAGE.enStage2:
            animationName = "ui-summary-01";
            break;

        case ENSTAGE.enStage3:
            animationName = "ui-summary-02";
            m_tick        = true;
            break;
        }

        SetAnimationSpeed(animationName, 1.0f);
        if (null != WindowRoot)
        {
            this.WindowRoot.GetComponent <Animation>().Play(animationName);
        }


        AnimationClip clip = WindowRoot.GetComponent <Animation>().GetClip(animationName);

        MainGame.Singleton.StartCoroutine(CoroutineAnimationEnd(++m_currentCorroutineIndex, clip.length, (ENSTAGE)(stage + 1)));
    }
示例#2
0
 public override void OnInit()
 {
     base.OnInit();
     AddPropChangedNotify((int)MVCPropertyID.enBattlePropsManager, OnPropertyChanged);
     m_sprite = FindChildComponent <UISprite>("MultiKillWord");
     m_anim   = WindowRoot.GetComponent <Animation>();
 }
        public IEnumerator Search_ToggleSearchView()
        {
            // Adding a GameObject to a SubScene
            var go    = new GameObject("go");
            var other = new GameObject("other");

            SceneManager.MoveGameObjectToScene(go, m_SubScene.EditingScene);
            SceneManager.MoveGameObjectToScene(other, m_SubScene.EditingScene);

            yield return(UpdateLiveLink());

            var searchField = WindowRoot.Q <SearchElement>();

            searchField.Search("go");

            yield return(null);

            Assert.That(WindowRoot.Q(name: Constants.EntityHierarchy.FullViewName), UIToolkitTestHelper.Is.Display(DisplayStyle.None));
            Assert.That(WindowRoot.Q(name: Constants.EntityHierarchy.SearchViewName), UIToolkitTestHelper.Is.Display(DisplayStyle.Flex));

            searchField.Search(string.Empty);

            yield return(null);

            Assert.That(WindowRoot.Q(name: Constants.EntityHierarchy.FullViewName), UIToolkitTestHelper.Is.Display(DisplayStyle.Flex));
            Assert.That(WindowRoot.Q(name: Constants.EntityHierarchy.SearchViewName), UIToolkitTestHelper.Is.Display(DisplayStyle.None));
        }
示例#4
0
 public void IntoStack(WindowRoot wnd)
 {
     if (!whiteStackWindows.Contains(wnd))
     {
         windowStack.Push(wnd);
     }
 }
示例#5
0
    private void InputMouse()
    {
        if (windowStack.Count > 1)
        {
            if (Input.GetMouseButtonDown(1))
            {
                if (loadingWnd.gameObject.activeSelf == false)
                {
                    WindowRoot window = topWindow;

                    if (whiteRightWindows.Contains(window))
                    {
                        AddTips("此窗口无法被快捷关闭!");
                    }
                    else
                    {
                        window.ReqCloseWnd();
                    }
                }
                else
                {
                    AddTips("正在加载,请勿频繁操作!");
                }
            }
        }
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            UnityAction UA = new UnityAction(ExitGame);
            AddDynTips("你确定要退出吗?", "退出程序", UA);
        }
    }
示例#6
0
    private void Update()
    {
        if (windowStack.Count >= 1)
        {
            topWindow = windowStack.Peek();

            if (nowWindow != topWindow)
            {
                Debug.Log("当前栈数:" + windowStack.Count + "---顶部窗口:" + topWindow.name);
                nowWindow = topWindow;
            }

            InputMouse();
        }

        if (LocalData.bugContent != null)
        {
            Debug.Log(LocalData.bugContent);
        }



        //foreach (WindowRoot window in windowStack)
        //{

        //    if (window == topWindow)
        //    {
        //        window.SetActive(window.gameObject, true);
        //    }
        //}
    }
示例#7
0
 public virtual void HideWindow()
 {
     if (WindowRoot != null)
     {
         if (WindowRoot.activeSelf)
         {//当前窗口是显示状态
             if (GlobalEnvironment.Singleton.IsInCallbackOrTrigger)
             {
                 DelegateCoroutine.CallStartCoroutine(WindowRoot, HideWindowImpl());
                 return;
             }
             WindowRoot.SetActive(false);
         }
         OnHideWindow();
         if (JoystickMap != null)
         {
             JoystickMap.OnDestroy();
         }
     }
     else
     {
         m_cacheStatus  |= CachedStatus.Visible;
         m_cacheVisiable = false;
     }
 }
示例#8
0
 public void ExitStack(WindowRoot wnd)
 {
     if (!whiteStackWindows.Contains(wnd))
     {
         windowStack.Pop();
     }
 }
        public IEnumerator Search_QuerySearch_IncludeSpecialEntity([Values(typeof(Prefab), typeof(Disabled))] Type componentType)
        {
            SceneManager.MoveGameObjectToScene(new GameObject("go"), m_SubScene.EditingScene);

            yield return(UpdateLiveLink());

            var e = m_Manager.CreateEntity();

            m_Manager.SetName(e, "Test entity");
            m_Manager.AddComponent <EntityGuid>(e);
            m_Manager.AddComponent(e, componentType);

            yield return(SkipAnEditorFrameAndDiffingUtility());

            var treeview     = WindowRoot.Q <TreeView>(Constants.EntityHierarchy.FullViewName);
            var expectedNode = EntityHierarchyNodeId.FromEntity(e);

            Assert.That(treeview.items.Cast <EntityHierarchyItem>().Select(i => i.NodeId), Does.Contain(expectedNode));

            var searchField = WindowRoot.Q <SearchElement>();

            searchField.Search($"c:{typeof(EntityGuid).FullName}");

            yield return(SkipAnEditorFrameAndDiffingUtility());

            var listview = WindowRoot.Q <ListView>(Constants.EntityHierarchy.SearchViewName);

            Assert.That(listview.itemsSource.Cast <EntityHierarchyItem>().Select(i => i.NodeId), Does.Contain(expectedNode));
        }
示例#10
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            ClearValue(SizeToContentProperty);
            WindowRoot.ClearValue(WidthProperty);
            WindowRoot.ClearValue(HeightProperty);

            Test();
        }
示例#11
0
 public override void OnInit()
 {
     base.OnInit();
     AddPropChangedNotify((int)MVCPropertyID.enTipMessageBox, OnPropertyChanged);
     m_anim     = WindowRoot.GetComponent <Animation>();
     m_panel    = WindowRoot.GetComponent <UIPanel>();
     m_clipTime = m_anim.GetClip("TipMessageBox").length;
 }
 // 播放 变成小图的动画
 void OnShowSmallCard(GameObject obj)
 {
     if (WindowRoot.GetComponent <Animation>().IsPlaying("UI-cardScaleMax-01"))
     {
         return;
     }
     WindowRoot.GetComponent <Animation>().Play("UI-cardScaleMax-01");
 }
示例#13
0
    public override void OnInit()
    {
        base.OnInit();
        AddPropChangedNotify((int)MVCPropertyID.enBattlePropsManager, OnPropertyChanged);

        m_labelNumber = FindChildComponent <UILabel>("ComboNumber");
        m_anim        = WindowRoot.GetComponent <Animation>();
    }
示例#14
0
    public override void OnInit()
    {
        base.OnInit();

        m_spriteSucc = FindChildComponent <UISprite>("qtedone");
        m_spriteFail = FindChildComponent <UISprite>("qtefailed");
        m_anim       = WindowRoot.GetComponent <Animation>();
        Reset();
    }
示例#15
0
    //拥有原地复活次数
//     public void OnOrigialFunc()
//     {
//         if (CanRetLayerResurrection())
//         {
//             if (m_resurrectionUnLimited)
//             {
//                 //有复活次数限制,显示复活剩余次数
//                 //如果复活剩余次数为0,原地复活按钮为灰
//             }
//             m_selectObj.SetActive(true);
//         }
//         else
//         {
//             UICommonMsgBoxCfg boxCfg = WindowRoot.GetComponent<UICommonMsgBoxCfg>();
//             UICommonMsgBox.GetInstance().ShowMsgBox(OnButtonOrigial, OnButtonNo, boxCfg);
//         }
//
//     }
//     public void ExecuteOrigial()
//     {
//         IResult r = BattleFactory.Singleton.CreateResult(ENResult.Relive, (int)EnMyPlayers.enChief, (int)EnMyPlayers.enChief);
//         if (r != null)
//         {
//             r.ResultExpr(null);
//             BattleFactory.Singleton.GetBattleContext().CreateResultControl().DispatchResult(r);
//         }
//         if (Team.Singleton.Deputy != null)
//         {
//             r = BattleFactory.Singleton.CreateResult(ENResult.Relive, (int)EnMyPlayers.enDeputy, (int)EnMyPlayers.enDeputy);
//             if (r != null)
//             {
//                 r.ResultExpr(null);
//                 BattleFactory.Singleton.GetBattleContext().CreateResultControl().DispatchResult(r);
//             }
//         }
//         HideWindow();
//         ++BattleArena.Singleton.ReliveCount;
//     }
//-------------------------------------------------------------
    public void OnButtonCacel(object sender, EventArgs e)
    {
        //BattleSummary.Singleton.OnFinished(false);
        //HideWindow();
        m_selectObj.SetActive(false);
        m_choiceLayerObj.SetActive(false);
        UICommonMsgBoxCfg boxCfg = WindowRoot.GetComponent <UICommonMsgBoxCfg>();

        UICommonMsgBox.GetInstance().ShowMsgBox(OnButtonYes, OnButtonNo, boxCfg);
    }
示例#16
0
    public void SetAnchors(Transform transform)
    {
        UILabel pointLable = WindowRoot.GetComponent <UILabel>();

        pointLable.rightAnchor.target  = transform;
        pointLable.leftAnchor.target   = transform;
        pointLable.bottomAnchor.target = transform;
        pointLable.topAnchor.target    = transform;

        WindowRoot.transform.parent = transform;
    }
示例#17
0
    public override void AttachEvent()
    {
        base.AttachEvent();
        AddChildMouseClickEvent("Skill1", OnButtonSkill1Clicked);
        AddChildMouseClickEvent("Skill2", OnButtonSkill2Clicked);
        AddChildMouseClickEvent("Skill3", OnButtonSkill3Clicked);
        AddChildMouseClickEvent("Skill4", OnButtonSkill4Clicked);
        AddChildMouseClickEvent("Skill5", OnButtonSkill5Clicked);
        AddChildMouseClickEvent("Skill6", OnButtonSkill6Clicked);
        AddChildMouseClickEvent("AddLevel2", OnButtonAddLevel2Clicked);
        AddChildMouseClickEvent("AddLevel3", OnButtonAddLevel3Clicked);
        AddChildMouseClickEvent("AddLevel4", OnButtonAddLevel4Clicked);
        AddChildMouseClickEvent("AddLevel5", OnButtonAddLevel5Clicked);
        AddChildMouseClickEvent("AddLevel6", OnButtonAddLevel6Clicked);
        AddChildMouseClickEvent("ActorLevelButton", OnButtOnAddActorLevel);

        AddChildMouseLongPressEvent("Skill1", OnButtonLongSkill1Clicked);
        AddChildMouseLongPressEvent("Skill2", OnButtonLongSkill2Clicked);
        AddChildMouseLongPressEvent("Skill3", OnButtonLongSkill3Clicked);
        AddChildMouseLongPressEvent("Skill4", OnButtonLongSkill4Clicked);
        AddChildMouseLongPressEvent("Skill5", OnButtonLongSkill5Clicked);
        AddChildMouseLongPressEvent("Skill6", OnButtonLongSkill6Clicked);

        AddChildMouseClickEvent("AutoAttack", OnButtonMarkAutoAttackClicked);
        AddChildMouseClickEvent("changeTarget", OnButtonChangeTargetClicked);
        AddChildMouseClickEvent("Return", OnButtonChangeSkillClicked);
        AddChildMouseClickEvent("AddComboBtn", OnButtonAddComboClicked);
        UpdateMarkState();

        JoystickWrap joystick = WindowRoot.GetComponent <JoystickWrap>();

        if (joystick != null)
        {
            if (joystick.m_axisMapping != null && joystick.m_axisMapping.Count > 0)
            {
                joystick.m_axisMapping[0].m_axisEvent += OnMoveClicked;
            }
            if (joystick.m_mapping != null)
            {
                for (int i = 0; i < joystick.m_mapping.Count; i++)
                {
                    if (joystick.m_mapping[i].m_name == "Scroll")
                    {
                        joystick.m_mapping[i].m_keyEvent += OnScrollClicked;
                    }
                    if (joystick.m_mapping[i].m_name == "SwitchActor")
                    {
                        joystick.m_mapping[i].m_keyEvent += SwitchActor;
                    }
                }
            }
        }
    }
        public IEnumerator Search_DisableSearchWhenSearchElementIsHidden()
        {
            // Adding a GameObject to a SubScene
            var go    = new GameObject("go");
            var other = new GameObject("other");

            SceneManager.MoveGameObjectToScene(go, m_SubScene.EditingScene);
            SceneManager.MoveGameObjectToScene(other, m_SubScene.EditingScene);

            yield return(UpdateLiveLink());

            var searchField = WindowRoot.Q <SearchElement>();

            searchField.Search("go");

            yield return(null);

            Assert.That(WindowRoot.Q(name: Constants.EntityHierarchy.FullViewName), UIToolkitTestHelper.Is.Display(DisplayStyle.None));
            Assert.That(WindowRoot.Q(name: Constants.EntityHierarchy.SearchViewName), UIToolkitTestHelper.Is.Display(DisplayStyle.Flex));
            var listView = WindowRoot.Q <ListView>(name: Constants.EntityHierarchy.SearchViewName);

            Assert.That(listView.itemsSource
                        .Cast <EntityHierarchyItem>()
                        .Select(x => x.CachedName), Is.EquivalentTo(new[] { k_SubSceneName, "go" }));

            var searchIcon = WindowRoot.Q(className: UssClasses.DotsEditorCommon.SearchIcon);

            m_Window.SendEvent(new Event
            {
                type          = EventType.MouseUp,
                mousePosition = searchIcon.worldBound.position
            });

            yield return(null);

            Assert.That(WindowRoot.Q(name: Constants.EntityHierarchy.FullViewName), UIToolkitTestHelper.Is.Display(DisplayStyle.Flex));
            Assert.That(WindowRoot.Q(name: Constants.EntityHierarchy.SearchViewName), UIToolkitTestHelper.Is.Display(DisplayStyle.None));

            m_Window.SendEvent(new Event
            {
                type          = EventType.MouseUp,
                mousePosition = searchIcon.worldBound.position
            });

            yield return(null);

            Assert.That(WindowRoot.Q(name: Constants.EntityHierarchy.FullViewName), UIToolkitTestHelper.Is.Display(DisplayStyle.None));
            Assert.That(WindowRoot.Q(name: Constants.EntityHierarchy.SearchViewName), UIToolkitTestHelper.Is.Display(DisplayStyle.Flex));
            Assert.That(listView.itemsSource
                        .Cast <EntityHierarchyItem>()
                        .Select(x => x.CachedName), Is.EquivalentTo(new[] { k_SubSceneName, "go" }));
        }
示例#19
0
    public Coroutine StartCoroutine(IEnumerator routine)
    {
        if (WindowRoot == null)
        {
            return(null);
        }
        DelegateCoroutine mono = WindowRoot.GetComponent <DelegateCoroutine>();

        if (mono == null)
        {
            mono = WindowRoot.AddComponent <DelegateCoroutine>();
        }
        return(mono.StartCoroutine(routine));
    }
示例#20
0
    IEnumerator HideWindowImpl()
    {
        yield return(new WaitForEndOfFrame());

        if (WindowRoot != null)
        {
            WindowRoot.SetActive(false);
            OnHideWindow();
        }
        else
        {
            m_cacheStatus  |= CachedStatus.Visible;
            m_cacheVisiable = false;
        }
    }
示例#21
0
    public void Update(int skillId)
    {
        CSItem card = CardBag.Singleton.m_cardForDetail;

        if (card == null)
        {
            return;
        }

        SkillInfo skillInfo = GameTable.SkillTableAsset.Lookup(skillId);

        if (null == skillInfo)
        {
            return;
        }
        IconInfomation iconInfo = GameTable.IconInfoTableAsset.Lookup(skillInfo.Icon);

        WindowRoot.GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName);


        // 身上是否有此技能

        m_lock.SetActive(!card.HaveSkill(skillId));


        int frameIconId = 0;

        // 是否是 切入技
        if (card.IsSwitchSkill(skillId))
        {
            frameIconId = (int)ENWorldParamIndex.enCardDetailSpecilSkillFrame;
        }
        else
        {
            frameIconId = (int)ENWorldParamIndex.enCardDetailSkillFrame;
        }

        WorldParamInfo worldInfo = GameTable.WorldParamTableAsset.Lookup(frameIconId);

        if (worldInfo != null)
        {
            iconInfo            = GameTable.IconInfoTableAsset.Lookup(worldInfo.IntTypeValue);
            m_frame.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName);
        }

        m_param.m_id = skillId;
    }
示例#22
0
 public virtual void ShowWindow()
 {
     if (WindowRoot != null)
     {
         WindowRoot.SetActive(true);
         OnShowWindow();
         if (JoystickMap != null && WindowRoot.activeInHierarchy)
         {
             JoystickMap.OnEnable();
         }
     }
     else
     {
         m_cacheStatus  |= CachedStatus.Visible;
         m_cacheVisiable = true;
     }
 }
示例#23
0
    // 自动翻滚 [8/3/2015 tgame]
    public void OnScrollClicked(JoystickWrap.JoystickKeyMapping k)
    {
        Vector3      f        = m_mainPlayer.MainObj.transform.forward;
        JoystickWrap joystick = WindowRoot.GetComponent <JoystickWrap>();

        if (joystick.m_axisMapping != null && joystick.m_axisMapping.Count > 0)
        {
            JoystickWrap.JoystickAxisMapping axis = joystick.m_axisMapping[0];
            if (axis.GetVector3D().sqrMagnitude > 0.01f)
            {
                f = axis.GetVector3D() * 5.0f;
            }
        }

        f = m_mainPlayer.MainPos + f * 3.0f;
        m_mainPlayer.CurrentCmd = new MainPlayer.Cmd(f, Player.ENCmdType.enRoll);
    }
示例#24
0
    public override void OnUpdate()
    {
        Actor actor = ActorManager.Singleton.Lookup(m_sobId);

        if (actor == null || actor.CenterPart == null)
        {
            HideWindow();
            return;
        }

        float zoomInScale = Map.Singleton.m_zoomInScale;
        float LBPosx      = SM.RandomRoomLevel.Singleton.mLBPos.x;
        float LBPosz      = SM.RandomRoomLevel.Singleton.mLBPos.z;

        WindowRoot.GetComponent <UILabel>().leftAnchor.absolute   = (int)((actor.CenterPart.transform.position.x - LBPosx) * zoomInScale) * 2;
        WindowRoot.GetComponent <UILabel>().bottomAnchor.absolute = (int)((actor.CenterPart.transform.position.z - LBPosz) * zoomInScale) * 2;
    }
        public IEnumerator Search_QuerySearch()
        {
            // Adding a GameObject to a SubScene
            SceneManager.MoveGameObjectToScene(new GameObject("go"), m_SubScene.EditingScene);

            yield return(UpdateLiveLink());

            var searchField = WindowRoot.Q <SearchElement>();

            searchField.Search($"c:{nameof(WorldTime)}");

            yield return(null);

            var listView = WindowRoot.Q <ListView>(name: Constants.EntityHierarchy.SearchViewName);
            var items    = listView.itemsSource.Cast <EntityHierarchyItem>().Select(x => x.CachedName);

            Assert.That(items, Is.EquivalentTo(new[] { nameof(WorldTime) }));
        }
示例#26
0
    public override void OnInit()
    {
        base.OnInit();

        AddPropChangedNotify((int)MVCPropertyID.enBattlePropsManager, OnPropertyChanged);
        mEventScript = WindowRoot.GetComponent("UIControlRealTimeEvent") as UIControlRealTimeEvent;
        UIRoot root = GameObject.FindObjectOfType <UIRoot>();

        if (null != root)
        {
            float    s      = (float)root.activeHeight / Screen.height;
            int      height = Mathf.CeilToInt(Screen.height * s);
            int      width  = Mathf.CeilToInt(Screen.width * s);
            UIWidget widget = WindowRoot.GetComponent <UIWidget>();
            UISprite sprite = widget as UISprite;
            sprite.width  = width;
            sprite.height = height;
        }
    }
示例#27
0
    private void InitStack()
    {
        Transform canvas = transform.Find("Canvas");

        for (int i = 0; i < canvas.childCount; i++)
        {
            WindowRoot wnd = canvas.GetChild(i).gameObject.GetComponent <WindowRoot>();
            if (wnd == null)
            {
                break;
            }
            if (wnd.gameObject.activeSelf == true && wnd != null && !whiteStackWindows.Contains(wnd))
            {
                wnd.gameObject.SetActive(false);
            }
        }

        topWindow.ReqOpenWnd();
    }
        public IEnumerator Search_NameSearch_NoResult()
        {
            SceneManager.MoveGameObjectToScene(new GameObject("go"), m_SubScene.EditingScene);

            yield return(UpdateLiveLink());

            var searchField = WindowRoot.Q <SearchElement>();

            searchField.Search("hello");

            yield return(null);

            Assert.That(WindowRoot.Q(name: Constants.EntityHierarchy.FullViewName), UIToolkitTestHelper.Is.Display(DisplayStyle.None));
            Assert.That(WindowRoot.Q(name: Constants.EntityHierarchy.SearchViewName), UIToolkitTestHelper.Is.Display(DisplayStyle.None));

            var centeredMessageElement = WindowRoot.Q <CenteredMessageElement>();

            Assert.That(centeredMessageElement, UIToolkitTestHelper.Is.Display(DisplayStyle.Flex));
            Assert.That(centeredMessageElement.Title, Is.EqualTo(EntityHierarchy.NoEntitiesFoundTitle));
            Assert.That(centeredMessageElement.Message, Is.Empty);
        }
        public IEnumerator Search_QuerySearch_NoResult()
        {
            SceneManager.MoveGameObjectToScene(new GameObject("go"), m_SubScene.EditingScene);

            yield return(UpdateLiveLink());

            var searchField = WindowRoot.Q <SearchElement>();

            searchField.Search("c:TypeThatDoesntExist");

            yield return(null);

            Assert.That(WindowRoot.Q(name: Constants.EntityHierarchy.FullViewName), UIToolkitTestHelper.Is.Display(DisplayStyle.Flex));
            Assert.That(WindowRoot.Q(name: Constants.EntityHierarchy.SearchViewName), UIToolkitTestHelper.Is.Display(DisplayStyle.None));

            var centeredMessageElement = WindowRoot.Q <CenteredMessageElement>();

            Assert.That(centeredMessageElement, UIToolkitTestHelper.Is.Display(DisplayStyle.Flex));
            Assert.That(centeredMessageElement.Title, Is.EqualTo(EntityHierarchy.ComponentTypeNotFoundTitle));
            Assert.That(centeredMessageElement.Message, Is.EqualTo(string.Format(EntityHierarchy.ComponentTypeNotFoundContent, "TypeThatDoesntExist")));
        }
        public IEnumerator Selection_DestroyingSelectedEntityDeselectInView()
        {
            var internalListView = WindowRoot.Q <TreeView>(Constants.EntityHierarchy.FullViewName).Q <ListView>();

            var e    = m_Manager.CreateEntity();
            var node = EntityHierarchyNodeId.FromEntity(e);

            yield return(SkipAnEditorFrameAndDiffingUtility());

            Assert.That(internalListView.currentSelectionIds, Is.Empty);

            EntitySelectionProxy.SelectEntity(m_Manager.World, e);
            yield return(null);

            Assert.That(internalListView.currentSelectionIds, Is.EquivalentTo(new[] { node.GetHashCode() }));

            m_Manager.DestroyEntity(e);
            yield return(SkipAnEditorFrameAndDiffingUtility());

            Assert.That(internalListView.selectedItems, Is.Empty);
        }