Project_WL/Assets/Script/Character/Projectile/Skill/Skill_BrutalSlash.cs

92 lines
3.1 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Skill_BrutalSlash : ProjectileBase
{
[Header("기본 투사체")]
public string m_projectile = "Projectile_BrutalSlash";
[Header("투사체 지속 시간")]
public float projectileTime = 2f;
[Header("마지막 투사체")]
public string m_projectilelast = "Projectile_BrutalSlashLast";
//List<ProjectileData> list_PD = new List<ProjectileData>
//{
// new ProjectileData(),new ProjectileData(),new ProjectileData(),new ProjectileData(),
//};
//public override void Set(ProjectileData _data)
//{
// base.Set(_data);
// _data.LifeTime = projectileTime;
// for (int i = 0; i < list_PD.Count; i++)
// _data.Copy(list_PD[i]);
// StartCoroutine(Co_Update());
//}
//IEnumerator Co_Update()
//{
// int i = 0;
// yield return new WaitForSeconds(0.3f);
// Shoot_Projectile(i++, m_projectile);
// yield return new WaitForSeconds(0.3f);
// Shoot_Projectile(i++, m_projectile);
// yield return new WaitForSeconds(0.4f);
// Shoot_Projectile(i++, m_projectile);
// yield return new WaitForSeconds(1.0f);
// Shoot_Projectile(i++, m_projectilelast);
// yield return null;
// Off(true);
// m_ProjecTileData.shooter.Stop(false);
//}
//void Shoot_Projectile(int index, string proj)
//{
// ProjectileInfo.Ins.Shoot_Projectile(proj, list_PD[index], pb =>
// {
// Vector3 randomPosition = GetRandomPositionInSector();
// pb.m_Pierce = true;
// pb.transform.position = m_ProjecTileData.shooter.Get_CenterPositionFoward();
// pb.transform.LookAt(
// new Vector3(randomPosition.x, m_ProjecTileData.shooter.Get_Center_position().y, randomPosition.z));
// });
//}
//Vector3 GetRandomPositionInSector()
//{
// return (Random.insideUnitSphere * 10f) +
// (m_ProjecTileData.shooter.Get_position() + m_ProjecTileData.shooter.transform.forward * 20f);
//}
public GameObject[] gos_effect;
public Projectile_StopAndColliderControl m_sacc;
public override void Set(ProjectileData _data)
{
_data.eStartPos = eProjectileStartPos.Shooter;
base.Set(_data);
StartCoroutine(Co_Update());
}
IEnumerator Co_Update()
{
OptionInfo.Ins.Set_PCMove(m_ProjecTileData.shooter, false);
DSUtil.InActivateGameObjects(gos_effect);
yield return new WaitForSeconds(0.1f);
DSUtil.InActivateGameObjects(gos_effect, 0);
var shooterpos = m_ProjecTileData.shooter.Get_position();
gos_effect[0].transform.position = new Vector3(shooterpos.x, 0f, shooterpos.z);
m_ProjecTileData.shooter.m_animation.speed = 0f;
yield return new WaitForSeconds(1.0f);
m_ProjecTileData.shooter.m_animation.speed = 1f;
DSUtil.InActivateGameObjects(gos_effect, 1);
m_sacc.Set(m_ProjecTileData);
yield return new WaitForSeconds(1.5f);
OptionInfo.Ins.Set_PCMove(m_ProjecTileData.shooter, true);
Off(true);
}
}