public IEnumerator ShowAppearAnim() { yield return(new WaitForSeconds(0.2f)); foreach (var monsterInfo in _MonsterShowDict.Values) { monsterInfo._AppearAnim.transform.position = monsterInfo._MonsterModel.transform.position; monsterInfo._AppearAnim.transform.localPosition += new Vector3(0, 50, 0); monsterInfo._AppearAnim.gameObject.SetActive(true); monsterInfo._AppearAnim.PlayEffect(); PlayerUISound(_BornSound, 1); yield return(new WaitForSeconds(0.4f)); monsterInfo._MonsterModel.gameObject.SetActive(true); monsterInfo._MonsterModel.PlayIdle(); } yield return(new WaitForSeconds(0.2f)); foreach (var monsterInfo in _MonsterShowDict.Values) { monsterInfo._UIHPItem.gameObject.SetActive(true); } UIFightBox.HideOptMask(); }
public void InitMonsters(List <MotionBase> monsters) { UIFightBox.ShowOptMask(); foreach (var monster in _MonsterShowDict.Values) { ResourcePool.Instance.RecvIldeModelItem(monster._MonsterModel.gameObject); } _MonsterShowDict.Clear(); for (int i = 0; i < _HPItem.Count; ++i) { _HPItem[i].gameObject.SetActive(false); if (monsters.Count > i) { MonsterShowInfo monShowInfo = new MonsterShowInfo(); monShowInfo._MonsterInfo = monsters[i]; monShowInfo._UIHPItem = _HPItem[i]; _MonsterShowDict.Add(monsters[i], monShowInfo); } } for (int i = 0; i < monsters.Count; ++i) { Hashtable hash = new Hashtable(); hash.Add("motion", monsters[i]); hash.Add("posIdx", i); hash.Add("posCnt", monsters.Count); ResourcePool.Instance.LoadModel(monsters[i]._MonsterRecord.Model, LoadMonsterFinish, hash); } int waveIdx = BattleField.Instance.StageLogic._Waves.Count - BattleField.Instance._CurWave; _WaveText.text = waveIdx.ToString(); }
public void TestStageUpdate() { if (_TestingStage == null) { return; } if (!UIFightBox.IsTestMode()) { UIFightBox.SetTest(); } if (UIStageSucess.IsShow() || UIStageFail.IsShow()) { TestStageInfo testInfo = new TestStageInfo(); if (UIStageSucess.IsShow()) { testInfo._IsWin = true; } else { testInfo._IsWin = false; } testInfo._Round = BattleField.Instance._BattleRound - 1; testInfo._RemainHP = (int)(((float)BattleField.Instance._RoleMotion._HP / BattleField.Instance._RoleMotion._MaxHP) * 10); testInfo._ElimitTrap = BallBox.Instance._ElimitTrapCnt; testInfo._ElimitBomb = BallBox.Instance._ElimitBombCnt; ++_TestTimes; _TestInfos[_TestingStage].Add(testInfo); LogicManager.Instance.ExitFight(); if (_TestTimes >= _DefaultTestTimes) { _TestTimes = 0; //++_CurIdx; //if (_CurIdx >= _TargetIdx) { _TestingStage = null; WriteRecords(); } //else //{ // _TestingStage = StageDataPack.Instance._StageItems[_CurIdx]; // _TestInfos.Add(_TestingStage, new List<TestStageInfo>()); // StageDataPack.Instance._FightingStage = _TestingStage; // LogicManager.Instance.EnterFight(_TestingStage); //} } else { StageDataPack.Instance._FightingStage = _TestingStage; LogicManager.Instance.EnterFight(_TestingStage); } } }
public void StartShowDamage(List <DamageResult> damageResults) { UIFightBox.ShowOptMask(); if (UIFightBox.IsTestMode()) { GameCore.Instance.EventController.PushEvent(EVENT_TYPE.EVENT_LOGIC_CAST_DAMAGE_FINISH, this, null); return; } StartCoroutine(DamageShow(damageResults)); }
public IEnumerator MonsterSkillShow(List <DamageResult> damageResults) { ClearDamageShow(); foreach (var damageResult in damageResults) { var monInfo = _MonsterShowDict[damageResult._TargetMotion]; float animTime = monInfo._MonsterModel.PlayAttack(); yield return(new WaitForSeconds(0.2f)); if (damageResult._UseSkill is SkillDamage) { PlayerUISound(_ElimitAttackSound, 1); } else if (damageResult._UseSkill != null) { PlayerUISound(_ElimitSkillSound, 1); } yield return(new WaitForSeconds(animTime - 0.2f)); _DmgTextNormal.transform.position = _HPBar.transform.position; _DmgTextNormal.transform.localPosition += new Vector3(0, 10, 0); _DmgTextNormal.gameObject.SetActive(true); _DmgTextNormal.text = "-" + damageResult.DamageValue; UpdateSelfHPBar(damageResult._AfterHP); if (damageResult._SkillBallsResult != null) { UIFightBox.ShowMonsterBalls(damageResult._SkillBallsResult); } yield return(new WaitForSeconds(0.3f)); ClearDamageShow(); if (damageResult._AfterHP <= 0 && BattleField.Instance._RoleMotion.IsDied) { UIStageFail.ShowAsyn(); } yield return(new WaitForSeconds(0.2f)); } RefreshMonsterCD(); GameCore.Instance.EventController.PushEvent(EVENT_TYPE.EVENT_LOGIC_MONSTER_SKILL_FINISH, this, null); UIFightBox.HideOptMask(); RefreshOptRound(); }
public void StartShowMonsterSkill(List <DamageResult> damageResult) { if (UIFightBox.IsTestMode()) { if (BattleField.Instance._RoleMotion._HP <= 0 && BattleField.Instance._RoleMotion.IsDied) { UIStageFail.ShowAsyn(); } UpdateSelfHPBar(BattleField.Instance._RoleMotion._HP); GameCore.Instance.EventController.PushEvent(EVENT_TYPE.EVENT_LOGIC_MONSTER_SKILL_FINISH, this, null); return; } StartCoroutine(MonsterSkillShow(damageResult)); }
public void PassStage(StageMapRecord passStageMap) { List <AwardItem> awardList = new List <AwardItem>(); _FightingStage = LogicManager.Instance.EnterStageInfo; var baseAward = AwardManager.AddAward(_FightingStage.StageRecord.AwardType[0], _FightingStage.StageRecord.AwardValue[0]); awardList.Add(baseAward); int starCnt = 0; for (int i = 0; i < 3; ++i) { if (_FightingStage.IsStarOn(i)) { continue; } bool isGetStar = true; if (passStageMap._StarInfos.Count > i) { isGetStar = StarInfoBase.isCanGetStar(passStageMap._StarInfos[i]); } if (isGetStar) { StageDataPack.Instance.SetStageStar(_FightingStage.StageRecord.Id, i); var starAward = AwardManager.AddAward(_FightingStage.StageRecord.AwardType[i + 1], _FightingStage.StageRecord.AwardValue[i + 1]); awardList.Add(starAward); } } for (int i = 0; i < 3; ++i) { if (_FightingStage.IsStarOn(i)) { ++starCnt; } } StageDataPack.Instance.SaveClass(true); UIFightBox.HideOptMask(); UIStageSucess.ShowAsyn(_FightingStage.StageRecord, starCnt, awardList); WeaponDataPack.Instance.RefreshUnLock(); }
public void StartEffect(BallType ballType, BallInfo baseBall, List <BallInfo> elimitBalls) { var uiBaseBall = UIFightBox.GetFightBall(baseBall); _IdleLighting = new List <GameObject>(_LightingGOList); foreach (var lightingGO in _LightingGOList) { lightingGO.gameObject.SetActive(false); } foreach (var elimitBall in elimitBalls) { if (elimitBall == baseBall) { continue; } var effectGO = GetIdleLightingGO(); effectGO.transform.SetParent(transform); var uiElimitBall = UIFightBox.GetFightBall(elimitBall); Vector3 direct = (uiElimitBall.transform.position - uiBaseBall.transform.position) * 0.5f; float ballDis = Vector3.Distance(uiBaseBall.transform.position, uiElimitBall.transform.position); float ballAngle = Vector3.Angle(direct, new Vector3(1, 0, 0)); if (direct.y < 0) { ballAngle = 180 - ballAngle; } float length = ballDis / 0.77f * 12; effectGO.transform.localScale = new Vector3(length, 50, 0); effectGO.transform.rotation = Quaternion.Euler(new Vector3(0, 0, ballAngle)); effectGO.transform.position = uiBaseBall.transform.position + direct; } StartCoroutine(EffectFinish()); }
public void EnterFightFinish() { UIFightBox.ShowStage(EnterStageInfo.StageRecord); GameCore.Instance._SoundManager.PlayBGMusic(GameCore.Instance._SoundManager._FightAudio); }
public void OnBtnFight() { UIFightBox.ShowStage(Tables.TableReader.StageInfo.GetRecord("1")); Hide(); }
private void SetMaxPos(List <BallInfo> elimitBalls) { BallInfo upBall = _BaseBall; BallInfo downBall = _BaseBall; BallInfo leftBall = _BaseBall; BallInfo rightBall = _BaseBall; List <BallInfo> outLineBalls = new List <BallInfo>(); foreach (var elimitBall in elimitBalls) { if (upBall.Pos.y < elimitBall.Pos.y && _BaseBall.Pos.x == elimitBall.Pos.x) { upBall = elimitBall; } if (downBall.Pos.y > elimitBall.Pos.y && _BaseBall.Pos.x == elimitBall.Pos.x) { downBall = elimitBall; } if (leftBall.Pos.x > elimitBall.Pos.x && _BaseBall.Pos.y == elimitBall.Pos.y) { leftBall = elimitBall; } if (rightBall.Pos.x < elimitBall.Pos.x && _BaseBall.Pos.y == elimitBall.Pos.y) { rightBall = elimitBall; } if (_BaseBall.Pos.y != elimitBall.Pos.y && _BaseBall.Pos.x != elimitBall.Pos.x) { outLineBalls.Add(elimitBall); } } var uiUpBall = UIFightBox.GetFightBall(upBall); var uiDownBall = UIFightBox.GetFightBall(downBall); var uiLeftBall = UIFightBox.GetFightBall(leftBall); var uiRightBall = UIFightBox.GetFightBall(rightBall); _MaxUp = uiUpBall.transform.position.y; _MaxDown = uiDownBall.transform.position.y; _MaxLeft = uiLeftBall.transform.position.x; _MaxRight = uiRightBall.transform.position.x; _StartTime = Time.time; foreach (var outlineBall in outLineBalls) { var uiOutLineBall = UIFightBox.GetFightBall(outlineBall); if ((int)outlineBall.Pos.y == (int)upBall.Pos.y && Mathf.Abs(outlineBall.Pos.x - upBall.Pos.x) < 2) { if (!_SubEffectInfos.ContainsKey(1)) { _SubEffectInfos.Add(1, new SubEffectInfo()); _SubEffectInfos[1]._SubEffectStart = uiUpBall.transform.position; } if (outlineBall.Pos.x < upBall.Pos.x) { _SubEffectInfos[1]._SubEffectEndBallUpLeft = uiOutLineBall.transform.position; _LeftSub[0].SetActive(true); } else { _SubEffectInfos[1]._SubEffectEndBallDownRight = uiOutLineBall.transform.position; _RightSub[0].SetActive(true); } } else if ((int)outlineBall.Pos.y == (int)downBall.Pos.y && Mathf.Abs(outlineBall.Pos.x - downBall.Pos.x) < 2) { if (!_SubEffectInfos.ContainsKey(2)) { _SubEffectInfos.Add(2, new SubEffectInfo()); _SubEffectInfos[2]._SubEffectStart = uiDownBall.transform.position; } if (outlineBall.Pos.x < downBall.Pos.x) { _SubEffectInfos[2]._SubEffectEndBallUpLeft = uiOutLineBall.transform.position; _LeftSub[1].SetActive(true); } else { _SubEffectInfos[2]._SubEffectEndBallDownRight = uiOutLineBall.transform.position; _RightSub[1].SetActive(true); } } else if ((int)outlineBall.Pos.x == (int)leftBall.Pos.x && Mathf.Abs(outlineBall.Pos.y - leftBall.Pos.y) < 2) { if (!_SubEffectInfos.ContainsKey(3)) { _SubEffectInfos.Add(3, new SubEffectInfo()); _SubEffectInfos[3]._SubEffectStart = uiLeftBall.transform.position; } if (outlineBall.Pos.y > leftBall.Pos.y) { _SubEffectInfos[3]._SubEffectEndBallUpLeft = uiOutLineBall.transform.position; _UpSub[0].SetActive(true); } else { _SubEffectInfos[3]._SubEffectEndBallDownRight = uiOutLineBall.transform.position; _DownSub[0].SetActive(true); } } else if ((int)outlineBall.Pos.x == (int)rightBall.Pos.x && Mathf.Abs(outlineBall.Pos.y - rightBall.Pos.y) < 2) { if (!_SubEffectInfos.ContainsKey(4)) { _SubEffectInfos.Add(4, new SubEffectInfo()); _SubEffectInfos[4]._SubEffectStart = uiRightBall.transform.position; } if (outlineBall.Pos.y > rightBall.Pos.y) { _SubEffectInfos[4]._SubEffectEndBallUpLeft = uiOutLineBall.transform.position; _UpSub[1].SetActive(true); } else { _SubEffectInfos[4]._SubEffectEndBallDownRight = uiOutLineBall.transform.position; _DownSub[1].SetActive(true); } } } }
public void SetFightBox(UIFightBox uiFightBox) { _UIFightBox = uiFightBox; }