public void UpdateState2() { _time++; _curScale = MathUtil.GetEaseOutQuadInterpolation(State1EndScale, State2EndScale, _time, _duration); _detectRadius = _curScale * DefaultRadius; //CheckCollisionWithEnemyBullets(); //CheckCollisionWithEnemy(); for (int i = 0; i < BombCount; i++) { _bombsTf[i].localScale = new Vector3(_curScale, _curScale, 1); _colliderList[i].SetSize(_detectRadius, _detectRadius); } if (_time >= _duration) { // 全屏伤害 ColliderCircle collider = ColliderManager.GetInstance().CreateColliderByType(eColliderType.Circle) as ColliderCircle; collider.SetSize(500, 500); collider.SetColliderGroup(eColliderGroup.EnemyBullet | eColliderGroup.Enemy); collider.SetPosition(Global.PlayerPos.x, Global.PlayerPos.y); collider.SetEliminateType(eEliminateDef.PlayerSpellCard); collider.SetHitEnemyDamage(150); collider.SetExistDuration(1); _curState = 3; } }
/// <summary> /// 创建一个销毁敌机子弹以及敌机的ObjectCollider /// </summary> private void CreateEliminateEnemyCollider(Vector2 pos) { // 清除子弹用的collider ColliderCircle collider = ColliderManager.GetInstance().CreateColliderByType(eColliderType.Circle) as ColliderCircle; collider.SetPosition(pos); collider.SetSize(0, 0); collider.SetEliminateType(eEliminateDef.SpellCardFinish); collider.SetColliderGroup(eColliderGroup.EnemyBullet | eColliderGroup.Enemy); collider.ScaleToSize(400, 400, 30); collider.SetExistDuration(30); }
protected virtual void StateWaitRebornUpdate() { RotateCollisionPoint(); _waitRebornTime++; // 创建消弹特效 if (_waitRebornTime == EliminateEffectTime) { ColliderCircle collider = ColliderManager.GetInstance().CreateColliderByType(eColliderType.Circle) as ColliderCircle; collider.SetSize(0, 0); collider.ScaleToSize(ElimiateEffectSize, ElimiateEffectSize, EliminateEffectDuration); collider.SetExistDuration(EliminateEffectDuration); collider.SetHitEnemyDamage(1); collider.SetEliminateType(eEliminateDef.PlayerDead); collider.SetColliderGroup(eColliderGroup.EnemyBullet | eColliderGroup.Enemy | eColliderGroup.Boss); } if (_waitRebornTime >= _waitRebornDuration) { _nextState = eCharacterState.Appear; } }