Ejemplo n.º 1
0
 void onStartBattle(Notification notification)
 {
     UIHome.SetActive(false);
     UIBattle.SetActive(true);
     GameManager.Instance.startGame();
     GameManager.Instance.uiState = UIState.E_UI_Battle;
 }
Ejemplo n.º 2
0
    static public void ShowBattle(bool isVisible)
    {
        if (!isVisible)
        {
            for (int i = 0; i < battleGroupList.Count; i++)
            {
                battleGroupList[i].isRenderingActive = false;
            }
        }

        if (currentBattleGroup)
        {
            currentBattleGroup.isRenderingActive = isVisible;
        }


        if (!Instance)
        {
            return;
        }

        Instance.battleCanvas.enabled = isVisible;

        if (isVisible)
        {
            if (currentBattleGroup)
            {
                UIBattle.ShowBattlePanel(currentBattleGroup.battleType);
            }
        }
    }
Ejemplo n.º 3
0
    private void StartFight()
    {
        //第一符卡,播放收放特效(关卡中途加入的boss不需要)
        if (!CardMgr.IsSingleCard())
        {
            PlayShirnkEffect(true);
        }

        //bossMark显示
        UIBattle.SetBossMarkActive(true);

        //血条
        var bossHpHudObj = ResourceMgr.Instantiate(ResourceMgr.LoadImmediately(BossHpBar));

        bossHpHudObj.transform.SetParent(gameObject.transform, false);
        _bossHpHud = bossHpHudObj.GetComponent <UIBossHpComponent>();
        _bossHpHud.Canvas.sortingOrder = SortingOrder.EnemyBullet + 1;
        _bossHpHud.Canvas.worldCamera  = StageCamera2D.Instance.MainCamera;

        //boss背景
        var circle = ResourceMgr.Instantiate(ResourceMgr.LoadImmediately(BossHpCircle));

        circle.transform.SetParent(gameObject.transform, false);
        _bossCircle = circle.GetComponent <UIBossCircleComponent>();

        //bossCard
        DOVirtual.DelayedCall(1F, CardMgr.OnStartFight, false);

        //禁止无敌
        Invisible = false;

        //场景卷轴恢复
        StageSceneBase.RevertSpeed();
    }
Ejemplo n.º 4
0
    private IEnumerator DoEnable(bool isFirstCard)
    {
        Master.Invisible = true;
        UIBattle.ShowBossTime(true, TotalTime);

        //血条 and boss背景处理
        switch (Phase)
        {
        case EBossCardPhase.One:
            Master.SetHpHudPointActive(true);
            Master.SetHpHudActive(true);
            break;

        case EBossCardPhase.Two:
            UIBossBg.Show(Master.Deploy.BossDraw);
            UIBattle.ShowBossCard(CardName);
            Master.SetHpHudPointActive(false);
            break;

        case EBossCardPhase.Single:
            Master.SetHpHudActive(true);
            break;
        }

        yield return(new WaitForSeconds(isFirstCard ? 0.5f : 1.5f));

        Master.Invisible = false;

        yield return(new WaitForSeconds(0.8f));

        Master.ShowCircleRaoDong(true);
        Inited = true;
    }
 public static void TimedPatch_Color3(UIBattle __instance, WuxiaUnit _unit)
 {
     if (bTimed)
     {
         UIHeal = _unit;
         UpdateTimedUI();
     }
 }
 public static void TimedPatch_Color5(UIBattle __instance, WuxiaUnit unit)
 {
     if (bTimed)
     {
         UISelected = null;
         UpdateTimedUI();
     }
 }
 public static void TimedPatch_Color4(UIBattle __instance)
 {
     if (bTimed)
     {
         UIHeal = null;
         UpdateTimedUI();
     }
 }
 public static void TimedPatch_Color2(UIBattle __instance)
 {
     if (bTimed)
     {
         UITarget = null;
         UpdateTimedUI();
     }
 }
Ejemplo n.º 9
0
    private IEnumerator DoBossDead()
    {
        //对话配置
        var dialogDeploy = DialogMgr.GetBossDialog(StageMgr.MainPlayer.Deploy.id, Deploy.id, false);

        //隐藏血条
        SetHpHudActive(false);

        //bossMark隐藏
        UIBattle.SetBossMarkActive(false);

        yield return(new WaitForSeconds(0.3f));

        //震屏
        if (StageCamera2D.Instance)
        {
            StageCamera2D.Instance.Shake(0.7f, 1.2f);
        }
        if (StageCamera3D.Instance)
        {
            StageCamera3D.Instance.Shake(0.7f, 1.2f);
        }

        Sound.PlayUiAudioOneShot(105);

        //播放shader特效
        StageCamera2D.Instance.PlayDeadEffect(transform.position);

        //隐藏renderer
        MainRenderer.enabled = false;
        if (_bossCircle)
        {
            _bossCircle.SetActiveSafe(false);
        }

        yield return(new WaitForSeconds(0.7f));

        //尝试显示对话
        if (dialogDeploy != null)
        {
            var list = DialogMgr.GetDrawList(dialogDeploy.dialogId);
            UIDrawingChat.Show(list, null,
                               () =>
            {
                GameEventCenter.Send(GameEvent.OnEnemyDie);
            });
        }
        else
        {
            GameEventCenter.Send(GameEvent.OnEnemyDie);
        }

        yield return(new WaitForSeconds(0.3f));

        Destroy(gameObject);
    }
Ejemplo n.º 10
0
    void Start()
    {
        UIHome   = transform.Find("UIHome").gameObject;
        UIBattle = transform.Find("UIBattle").gameObject;

        UIHome.SetActive(true);
        UIBattle.SetActive(false);

        NotificationCenter.DefaultCenter().AddObserver(this, "onStartBattle");
        NotificationCenter.DefaultCenter().AddObserver(this, "onBackHome");
    }
Ejemplo n.º 11
0
    public void OnDisable()
    {
        if (Phase == EBossCardPhase.One)
        {
            Master.SetHpHudPointActive(false);
        }
        else
        {
            Master.SetHpHudActive(false);
        }

        Master.ShowCircleRaoDong(false);
        UIBossBg.FadeOut();
        UIBattle.ShowBossTime(false);
        UIBattle.HideBossCard();
    }
Ejemplo n.º 12
0
    /// <summary>
    /// 打开界面对外接口
    /// </summary>
    /// <param name="type"></param>
    /// <param name="param"></param>
    /// <param name="go"></param>
    public static void ManageWinwodOpen(WindowAction type, object param = null, GameObject go = null)
    {
        WindowActionParameter para = new WindowActionParameter(type, param, go);

        switch (para.type)
        {
        case WindowAction.Open_UICombatReadiness:
            OpenWindow <UICombatReadiness>(UIFilePath.UICombatReadiness, WindowType.Full);
            break;

        case WindowAction.Open_UIBattle:
            UIBattle ub = OpenWindow <UIBattle>(UIFilePath.UIBattle, WindowType.Full);
            para.go = ub.gameObject;
            break;;
        }
    }
Ejemplo n.º 13
0
    private void UpdateState()
    {
        // game state machine
        switch (this.GameState)
        {
        case EGameState.SPLASH:
        {
            this.Player1.Phase = EPlayerPhase.FREE;
            this.Player2.Phase = EPlayerPhase.FREE;

            this.UIMgr.HideAllNodes();
            this.UIMgr.SplashNode.SetActive(true);
            this.SetState(EGameState.WAIT);
        }
        break;

        case EGameState.SELECT:
        {
            this.Player1.Phase       = EPlayerPhase.SELECT;
            this.Player2.Phase       = EPlayerPhase.SELECT;
            this.Player1.CharacterID = 1;
            this.Player2.CharacterID = 2;

            this.UIMgr.HideAllNodes();
            this.UIMgr.SelectNode.SetActive(true);
            this.SetState(EGameState.WAIT);
        }
        break;

        case EGameState.BATTLE:
        {
            this.Player1.InitBattle();
            this.Player2.InitBattle();


            this.UIMgr.HideAllNodes();
            this.UIMgr.BattleNode.SetActive(true);
            UIBattle ui = this.UIMgr.BattleNode.GetComponent <UIBattle>();
            ui.Init();
            this.SetState(EGameState.WAIT);
        }
        break;

        default:
            break;
        }
    }
Ejemplo n.º 14
0
    protected override void OnLoadFinish()
    {
        base.OnLoadFinish();
        _bind    = GetComponent <UIBattleComponent>();
        Instance = this;

        _bind.LeftTimeRoot.gameObject.SetActiveSafe(false);

        _defaultLeftTimePos  = _bind.LeftTimeRoot.anchoredPosition;
        _defaultCardNamePos  = _bind.CardNameRoot.anchoredPosition;
        _defaultCardBonusPos = _bind.CardBonusRoot.anchoredPosition;

        RefreshDifficult();
        RefreshLifeCount();

        GameEventCenter.AddListener(GameEvent.LifeCountChanged, RefreshLifeCount);

        InitDebug();
    }
Ejemplo n.º 15
0
    public void SetTimer(UIBattle _owner, float time, ETurnTimeType type)
    {
        mBattleScene = Global.SceneMgr.CurrentScene as BattleScene;
        Owner        = _owner;

        Type        = type;
        Time        = time;
        TimeElapsed = 0;

        LabelTurnTimer.text = time.ToString() + " Sec";
        if (type == ETurnTimeType.TURNTIME_SEL_ACTIONTYPE)
        {
            SpriteBackImage.spriteName = "stayToAttack";
        }
        else
        {
            SpriteBackImage.spriteName = "stayToTarget";
        }
        gameObject.SetActive(true);
    }
Ejemplo n.º 16
0
 /// <summary> 재시작 버튼 눌렀을 때 </summary>
 public void OnClickRestart()
 {
     UIBattle.ShowRestartConfirmPopup();
 }
Ejemplo n.º 17
0
 protected override void OnDestroy()
 {
     base.OnDestroy();
     GameEventCenter.RemoveListener(GameEvent.LifeCountChanged, RefreshLifeCount);
     Instance = null;
 }
Ejemplo n.º 18
0
        public static void openElementUI()
        {
            Heluo.Logger.LogError("openElementUI start");
            if (nonbattleChangeElement.Value)
            {
                //show结束时ctrlMartialArts还没当前角色数据,需要从ctrlhome处获得

                List <CharacterMapping> characterMapping = Traverse.Create(homeController).Field("characterMapping").GetValue <List <CharacterMapping> >();
                int communityIndex = Traverse.Create(homeController).Field("communityIndex").GetValue <int>();

                CharacterMapping mapping = characterMapping[communityIndex];
                characterInfoData = Game.GameData.Character[mapping.InfoId];
                clickSkill        = characterInfoData.GetSkill(characterInfoData.SpecialSkill);

                //不是切换功体或召唤技能
                if (clickSkill == null || (clickSkill.Item.DamageType != DamageType.ChangeElement && clickSkill.Item.DamageType != DamageType.Summon))
                {
                    return;
                }
                //mp不足
                if (characterInfoData.MP < clickSkill.Item.RequestMP)
                {
                    string text2 = Game.Data.Get <StringTable>("SecondaryInterface1207").Text;
                    Game.UI.AddMessage(text2, UIPromptMessage.PromptType.Normal);
                    return;
                }

                //切换功体
                if (clickSkill.Item.DamageType == DamageType.ChangeElement)
                {
                    Game.MusicPlayer.Current_Volume = 0.5f;

                    //从uibattle处获得五行盘ui
                    UIBattle      uiBattle     = Game.UI.Open <UIBattle>();
                    WgBattleRound battle_round = uiBattle.battle_round;
                    battle_round.gameObject.SetActive(false);//隐藏右上角的回合数
                    UIAttributeList attr_list = Traverse.Create(uiBattle).Field("attr_list").GetValue <UIAttributeList>();

                    //图层设置为最前,否则会被挡住
                    Game.UI.SetParent(attr_list.transform, UIForm.Depth.Front);
                    attr_list.transform.SetAsLastSibling();

                    attr_list.Show();
                    attr_list.SetOriginElement((int)characterInfoData.Element, new Action <int>(OnElementSelect), delegate
                    {
                        Game.MusicPlayer.Current_Volume = 1f;
                    });
                }
                //召唤小熊猫,开启乖乖技能列表
                else if (nonbattleUseHealSkill.Value && clickSkill.Item.DamageType == DamageType.Summon)
                {
                    CharacterInfoData  characterInfoData = Game.GameData.Character["in91001"];
                    CharacterSkillData skill             = characterInfoData.Skill;
                    Props equip = characterInfoData.Equip.GetEquip(EquipType.Weapon);
                    if (equip == null)
                    {
                        return;
                    }
                    List <SkillData> list          = new List <SkillData>();
                    PropsCategory    propsCategory = equip.PropsCategory;
                    foreach (string key in skill.Keys)
                    {
                        SkillData skillData = skill[key];
                        if (skillData.Item == null)
                        {
                            Debug.LogError("Skill表中找不到" + skillData.Id + "的文本");
                        }
                        else if (!(skillData.Item.Id == characterInfoData.SpecialSkill))
                        {
                            list.Add(skillData);
                        }
                    }
                    if (list.Count > 0)
                    {
                        MartialArtsWindowInfo martialArtsWindowInfo = new MartialArtsWindowInfo();
                        martialArtsWindowInfo.Mapping = new CharacterMapping();
                        Npc npc = Game.Data.Get <Npc>("in91001");
                        martialArtsWindowInfo.Mapping.Id         = "in91001";
                        martialArtsWindowInfo.Mapping.InfoId     = npc.CharacterInfoId;
                        martialArtsWindowInfo.Mapping.ExteriorId = npc.ExteriorId;
                        martialArtsWindowInfo.Sort        = list;
                        martialArtsWindowInfo.SkillColumn = (CtrlMartialArts.UISkillColumn) 5;
                        Game.UI.Open <UIMartialArtsWindow>().OpenWindow(martialArtsWindowInfo, null);
                        return;
                    }
                }
            }
        }
Ejemplo n.º 19
0
 protected override void Update()
 {
     base.Update();
     UpdateHpHud();
     UIBattle.SetBossMarkPos(transform.position);
 }