protected Gun(GunType gunType, int powerLevel, int bulletSpeed, float bulletFiringDelay, int bulletDamage, PlayerUltimateType playerUltimateType, PlayerSupporterType playerSupporterType) { this.m_GunType = gunType; this.m_PowerLevel = powerLevel; this.m_BulletSpeed = bulletSpeed; this.m_CurrentBulletFiringTime = 0.0f; this.m_BulletFiringDelay = bulletFiringDelay; this.m_IsFireEnabled = true; this.m_BulletDamage = bulletDamage; this.m_PlayerUltimateType = playerUltimateType; this.m_PlayerSupporterType = playerSupporterType; this.m_CorePool = new GunCorePool(); }
public void SpawnPlayerSupporter(PlayerSupporterType playerSupporterType) { switch (playerSupporterType) { case PlayerSupporterType.Missile: break; case PlayerSupporterType.Guider: { GunVulcan playerGun = m_PlayerManager.GetPlayerGun() as GunVulcan; if (playerGun.GetPlayerSupporterCount() >= playerGun.GetMaxPlayerSupporterCount()) { //HP 만땅같은거 넣어줘도 될뜻 아무 효과도 없으니.. return; } PlayerSupporterController controller = m_PlayerManager.GetPlayer().GetComponent <PlayerSupporterController>(); Transform[] playerSupporterStandardTransforms = controller.m_SupporterPositionTransforms; Vector3 spawnPosition; //float spawnRotation = playerGun.GetPlayerSupporterCount() == 0 ? -90.0f : 90.0f; float endRotationBy = playerGun.GetPlayerSupporterCount() == 0 ? -270.0f : 270.0f; if (m_PlayerManager.GetPlayer().transform.position.x < m_StageManager.GetScreenSize().Width / 2) { spawnPosition = m_EnemyManager.GetEnemySpawnPoints(Direction.Left)[Random.Range(0, 5)].position; } else { spawnPosition = m_EnemyManager.GetEnemySpawnPoints(Direction.Right)[Random.Range(0, 5)].position; } PlayerSupporterCore supporterCore = Instantiate(m_Guider, spawnPosition, Quaternion.Euler(0.0f, 0.0f, /*spawnRotation*/ 0.0f)).GetComponent <PlayerSupporterCore>(); supporterCore.SetHp(30); //DOTween.Sequence().Append(supporterCore.gameObject.transform.DOBlendableLocalRotateBy(new Vector3(0.0f, 0.0f, endRotationBy), 2.0f)); playerGun.AddSupporter(supporterCore); break; } case PlayerSupporterType.Vulcan: break; } }
protected override void Awake() { base.Awake(); m_PlayerSupporterType = PlayerSupporterType.Default; m_PlayerManager = ManagerPool.GetInstance().GetManager <PlayerManager>(); m_Tween = gameObject.transform.DOMove(new Vector3(), 0.2f).SetAutoKill(false); m_Tween.Pause(); m_LastPosition = new Vector3(); if (m_FireTransforms.Length == 0) { throw new ObjectNullException(typeof(PlayerSupporterCore), nameof(m_FireTransforms)); } EventCore() .Wait(1.0f) .AppendAttackCornShot(m_FireTransforms[0], 10, 200.0f, EntityBulletType.SmallBean, 0.0f, 1, AllyFlag.Player, Vector3.up) .Loop(true) .Run(); }
public PlayerSupporterCore SetItemType(PlayerSupporterType itemType) { m_PlayerSupporterType = itemType; return(this); }