/// <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; } }