public AttackAction(MonoBehaviour monoBehaviour, Transform fireTransform, Vector3 defaultDirection, int bulletDamage, float bulletSpeed, EntityBulletType EntityBulletType, AllyFlag allyFlag) { this.m_MonoBehaviour = monoBehaviour; this.m_Waitor = new EventWaitor(monoBehaviour); this.m_FireTransform = fireTransform; this.m_BulletManager = ManagerPool.GetInstance().GetManager <BulletManager>(); this.m_BulletDamage = bulletDamage; this.m_BulletSpeed = bulletSpeed; this.m_EntityBulletType = EntityBulletType; this.m_DefaultDirection = defaultDirection; this.m_AllyFlag = allyFlag; }
private bool m_FollowRotation; //공격방향에따라 회전할지 public TornadoShot(MonoBehaviour monoBehaviour, Transform fireTransform, Vector3 defaultDirection, int bulletDamage, float bulletSpeed, AllyFlag allyFlag, EntityBulletType EntityBulletType, int bulletCount, float duration, bool followRotation, Direction direction = Direction.ClockWise) : base(monoBehaviour, fireTransform, defaultDirection, bulletDamage, bulletSpeed, EntityBulletType, allyFlag) { this.m_BulletCount = bulletCount; this.m_Duration = duration; this.m_Direction = direction; this.m_FollowRotation = followRotation; }
public AttackAction SetGuidedShot(Vector3 defaultDirection, int bulletDamage, float bulletSpeed, EntityBulletType EntityBulletType, AllyFlag allyFlag, float shotInterval, int bulletCount, Func <GameObject> targetGetter) { m_AttackActionType = AttackActionType.TornadoShot; m_AttackAction = new GuidedShot(m_MonoBehaviour, m_FireTransform, defaultDirection, bulletDamage, bulletSpeed, EntityBulletType, allyFlag, bulletCount, shotInterval, targetGetter); return(m_AttackAction as GuidedShot); }
public AttackAction SetTornadoShot(Vector3 defaultDirection, int bulletDamage, float bulletSpeed, EntityBulletType EntityBulletType, AllyFlag allyFlag, int bulletCount, float duration, bool followRatation = true, TornadoShot.Direction direction = TornadoShot.Direction.ClockWise) { m_AttackActionType = AttackActionType.TornadoShot; m_AttackAction = new TornadoShot(m_MonoBehaviour, m_FireTransform, defaultDirection, bulletDamage, bulletSpeed, allyFlag, EntityBulletType, bulletCount, duration, followRatation, direction); return(m_AttackAction as TornadoShot); }
public AttackAction SetCornShot(Vector3 defaultDirection, int bulletDamage, float bulletSpeed, EntityBulletType EntityBulletType, AllyFlag allyFlag, float degree, int bulletCount) { m_AttackActionType = AttackActionType.TornadoShot; m_AttackAction = new CornShot(m_MonoBehaviour, m_FireTransform, defaultDirection, bulletDamage, bulletSpeed, EntityBulletType, allyFlag, degree, bulletCount); return(m_AttackAction as TornadoShot); }
public CornShot(MonoBehaviour monoBehaviour, Transform fireTransform, Vector3 defaultDirection, int bulletDamage, float bulletSpeed, EntityBulletType EntityBulletType, AllyFlag allyFlag, float degree, int bulletCount) : base(monoBehaviour, fireTransform, defaultDirection, bulletDamage, bulletSpeed, EntityBulletType, allyFlag) { this.m_Degree = degree; this.m_BulletCount = bulletCount; }
public GuidedShot(MonoBehaviour monoBehaviour, Transform fireTransform, Vector3 defaultDirection, int bulletDamage, float bulletSpeed, EntityBulletType EntityBulletType, AllyFlag allyFlag, int bulletCount, float shotInterval, Func <GameObject> targetGetter) : base(monoBehaviour, fireTransform, defaultDirection, bulletDamage, bulletSpeed, EntityBulletType, allyFlag) { this.m_ShotInterval = shotInterval; this.m_BulletCount = bulletCount; this.m_TargetGetter = targetGetter; }
public GameObject SpawnBullet(EntityBulletType type, Vector3 position, Quaternion rotation, EntityCore core, float speed, int damage, Vector3 defaultDirection, AllyFlag allyFlag, bool selfControlled = false, Vector3 noramalizedDirection = default) { Rect bottomRectangle = new Rect(new Vector2(-15.0f, -15.0f), new Vector2(90.0f, 13.0f)); Rect topRectangle = new Rect(new Vector2(-15.0f, 102.0f), new Vector2(90.0f, 13.0f)); Rect leftRectangle = new Rect(new Vector2(-15.0f, -15.0f), new Vector2(13.0f, 130.0f)); Rect rightRectangle = new Rect(new Vector2(62.0f, -15.0f), new Vector2(13.0f, 130.0f)); if (bottomRectangle.Contains(position)) { return(null); } if (topRectangle.Contains(position)) { return(null); } if (leftRectangle.Contains(position)) { return(null); } if (rightRectangle.Contains(position)) { return(null); } GameObject bulletPrefab = GetEnemyBulletPrefabObject(type); if (bulletPrefab == null) { throw new Exception(type.ToString() + "의 불렛프리팹을 가져오는데 실패했습니다"); } GameObject gameObject = Instantiate(bulletPrefab, position, rotation); switch (allyFlag) { case AllyFlag.Player: gameObject.SetTagIncludeAllChildren("PlayerBullet"); break; case AllyFlag.Enemy: gameObject.SetTagIncludeAllChildren("EnemyBullet"); break; } EntityBulletInfo comp = gameObject.AddComponent <EntityBulletInfo>(); comp.SetSpeed(speed); comp.SetSelfControlled(selfControlled); comp.SetDamage(damage); comp.SetEntityCore(core); comp.SetDirection(noramalizedDirection); comp.SetDefaultDirection(defaultDirection); gameObject.GetComponent <EntityBulletMovementController>().SetEntityBulletInfo(comp); return(gameObject); }
public EntityEventAttackCore AppendAttackGuidedShot(Transform firetransform, int bulletDamage, float bulletSpeed, EntityBulletType type, int bulletCount, float shotInterval, Func <GameObject> targetGetter, AllyFlag allyFlag = AllyFlag.Enemy, Vector3?defaultDirection = null) { if (defaultDirection == null) { defaultDirection = Vector3.down; } EventAttack colortoAction = new EventAttack(m_IsSequence, m_MonoBehaviour, firetransform); colortoAction.SetGuidedShot(defaultDirection.Value, bulletDamage, bulletSpeed, type, allyFlag, shotInterval, bulletCount, targetGetter); m_EventList.Enqueue(colortoAction); return(this); }
public EntityEventAttackCore AppendAttackCornShot(Transform firetransform, int bulletDamage, float bulletSpeed, EntityBulletType type, float degree, int bulletCount, AllyFlag allyFlag = AllyFlag.Enemy, Vector3?defaultDirection = null) { if (defaultDirection == null) { defaultDirection = Vector3.down; } EventAttack colortoAction = new EventAttack(m_IsSequence, m_MonoBehaviour, firetransform); colortoAction.SetCornShot(defaultDirection.Value, bulletDamage, bulletSpeed, type, allyFlag, degree, bulletCount); m_EventList.Enqueue(colortoAction); return(this); }
public EntityEventAttackCore AppendAttackTornadoShot(Transform firetransform, int bulletDamage, float bulletSpeed, EntityBulletType type, int bulletCount, float duration, bool followRotation, AllyFlag allyFlag = AllyFlag.Enemy, Vector3?defaultDirection = null, EventAttack.TornadoShot.Direction direction = EventAttack.TornadoShot.Direction.ClockWise) { if (defaultDirection == null) { defaultDirection = Vector3.down; } EventAttack colortoAction = new EventAttack(m_IsSequence, m_MonoBehaviour, firetransform); colortoAction.SetTornadoShot(defaultDirection.Value, bulletDamage, bulletSpeed, type, allyFlag, bulletCount, duration, followRotation, direction); m_EventList.Enqueue(colortoAction); return(this); }
private void FireUltimate() { GameObject playerObject = m_PlayerManager.GetPlayer(); switch (m_PlayerGun.GetPlayerUltimateType()) { case PlayerUltimateType.Plane: { /* 울티메이트 플레인 공격지점 인덱스 위 -> 아래 그리고 왼쪽 -> 오른쪽 순으로 시작됨 * * '(0) * '(1) '(2) * '(3) '(4) * '(5) '(6) * */ GameObject ultimateObject = Instantiate(m_UltimatePlane, new Vector3(playerObject.transform.position.x, -10.0f, -5.0f), Quaternion.Euler(0.0f, 0.0f, 0.0f)); PlayerUltimateCore ultimateCore = ultimateObject.GetComponent <PlayerUltimateCore>().SetHp <PlayerUltimateCore>(1500); Transform[] fireTransforms = ultimateCore.GetUltimateFireTransforms(); int bulletDamage = 10; float bulletSpeed = 100.0f; Vector3 defaultDirection = Vector3.up; EntityBulletType bulletType = EntityBulletType.SmallBean; AllyFlag allyFlag = AllyFlag.Player; DOTween.Sequence() .AppendCallback(() => { m_PlayerManager.SetPlayerUltimateCount(m_PlayerManager.GetPlayerUltimateCount() - 1); m_PlayerManager.GetPlayerGun()?.SetUltimateEnabled(false); m_PlayerManager.SetIsInvincible(true); playerObject.transform.position = new Vector3( playerObject.transform.position.x, playerObject.transform.position.y, -6.0f ); }) .Append(playerObject.transform.DOScale(new Vector3(2.0f, 2.0f, 1.0f), 1.0f)) .Insert(0.0f, playerObject.transform.DOBlendableRotateBy(new Vector3(160.0f, 0.0f), 1.0f)) .Append(playerObject.transform.DOBlendableRotateBy(new Vector3(200.0f, 0.0f), 1.3f)) .Insert(1.0f, playerObject.transform.DOScale(new Vector3(1.0f, 1.0f, 1.0f), 1.0f)) .AppendInterval(0.6f) .AppendCallback(() => { m_PlayerManager.SetIsInvincible(false); playerObject.transform.position = new Vector3( playerObject.transform.position.x, playerObject.transform.position.y, -5.0f ); }) .Play(); EntityEventAttackCore eventCore = ultimateCore .OnDestroyCallBack(() => m_PlayerManager.GetPlayerGun()?.SetUltimateEnabled(true)) .EventCore() .AppendActionMoveTo(playerObject.transform.position, 2.0f) .Spawn() .AppendActionMoveBy(new Vector3(0.0f, 200.0f), 40.0f) .Sequence(); for (int i = 0; i < 40; i++) { eventCore .AppendAttackCornShot(fireTransforms[0], bulletDamage, bulletSpeed, bulletType, 0.0f, 1, allyFlag, defaultDirection) .AppendAttackCornShot(fireTransforms[1], bulletDamage, bulletSpeed, bulletType, 0.0f, 1, allyFlag, defaultDirection) .AppendAttackCornShot(fireTransforms[2], bulletDamage, bulletSpeed, bulletType, 0.0f, 1, allyFlag, defaultDirection) .AppendAttackCornShot(fireTransforms[3], bulletDamage, bulletSpeed, bulletType, 0.0f, 1, allyFlag, defaultDirection) .AppendAttackCornShot(fireTransforms[4], bulletDamage, bulletSpeed, bulletType, 0.0f, 1, allyFlag, defaultDirection) .AppendAttackCornShot(fireTransforms[5], bulletDamage, bulletSpeed, bulletType, 0.0f, 1, allyFlag, defaultDirection) .AppendAttackCornShot(fireTransforms[6], bulletDamage, bulletSpeed, bulletType, 0.0f, 1, allyFlag, defaultDirection) .Wait(0.5f); } eventCore.Run(); } break; default: break; } }