인디케이터, 투사체 로드 리팩토링
This commit is contained in:
parent
c95e6a73e0
commit
c3f6b6c82a
|
|
@ -1,3 +1,4 @@
|
||||||
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
|
@ -21,24 +22,20 @@ public class Boss_GolemChild : BossMobActor
|
||||||
[Header("스킬2 데미지")]
|
[Header("스킬2 데미지")]
|
||||||
public float Skill2Dmg = 3f;
|
public float Skill2Dmg = 3f;
|
||||||
[Header("스킬2 인디케이터")]
|
[Header("스킬2 인디케이터")]
|
||||||
public string Skill12ndicator = "Golem_Child_Skill2_Indicator";
|
public string Skill2Indicator = "Golem_Child_Skill2_Indicator";
|
||||||
|
|
||||||
Projectile_Curved pc_Lock;
|
ProjectileBase pb_Lock, pb_LockExp, pb_Skill2;
|
||||||
ProjectileBase pb_LockExp, pb_Skill2;
|
|
||||||
|
|
||||||
public override void Set(bool isEnemy, Actor owner, ServerData sdata, int _id, bool _stop, bool _ui = false)
|
public override void Set(MonsterTableData mobtable, Vector3 pos, Action<int> actDie, int order)
|
||||||
{
|
{
|
||||||
base.Set(isEnemy, owner, sdata, _id, _stop, _ui);
|
base.Set(mobtable, pos, actDie, order);
|
||||||
|
|
||||||
if (DSUtil.CheckNull(go_indicator1)) IndicatorInfo.Ins.Make_Indicator(Skill1Indicator, go => { go_indicator1 = go; });
|
Load_Indicator(Skill1Indicator, 0);
|
||||||
if (DSUtil.CheckNull(go_indicator2)) IndicatorInfo.Ins.Make_Indicator(Skill12ndicator, go => { go_indicator2 = go; });
|
Load_Indicator(Skill2Indicator, 1);
|
||||||
|
|
||||||
ProjectileInfo.Ins.Shoot_Projectile("FieldBoss/Golem_Child_Lock", this, m_Target, Skill1Dmg, tf_Skill1Pos.position, 10f,
|
Load_Projectile("FieldBoss/Golem_Child_Lock", Skill1Dmg, tf_Skill1Pos.position, 10f, pb_Lock, pb => pb_Lock = pb);
|
||||||
pb => { pc_Lock = pb as Projectile_Curved; pc_Lock.gameObject.SetActive(false); });
|
Load_Projectile("FieldBoss/Golem_Child_LockExp", Skill1AreaDmg, Vector3.zero, 10f, pb_LockExp, pb => pb_LockExp = pb);
|
||||||
ProjectileInfo.Ins.Shoot_Projectile("FieldBoss/Golem_Child_LockExp", this, m_Target, Skill1AreaDmg, Vector3.zero, 10f,
|
Load_Projectile("FieldBoss/Golem_Child_Skill2", Skill2Dmg, Vector3.zero, 10f, pb_Skill2, pb => pb_Skill2 = pb);
|
||||||
pb => { pb_LockExp = pb; pb_LockExp.gameObject.SetActive(false); });
|
|
||||||
ProjectileInfo.Ins.Shoot_Projectile("FieldBoss/Golem_Child_Skill2", this, m_Target, Skill2Dmg, Vector3.zero, 10f,
|
|
||||||
pb => { pb_Skill2 = pb; pb_Skill2.gameObject.SetActive(false); });
|
|
||||||
|
|
||||||
CoolTime_Skill1 = 1f;
|
CoolTime_Skill1 = 1f;
|
||||||
CoolTime_Skill2 = 2f;
|
CoolTime_Skill2 = 2f;
|
||||||
|
|
@ -66,18 +63,18 @@ public class Boss_GolemChild : BossMobActor
|
||||||
{
|
{
|
||||||
Change_MobStatus(eMobStatus.Skill);
|
Change_MobStatus(eMobStatus.Skill);
|
||||||
AnimationPlay("boss_skill1");
|
AnimationPlay("boss_skill1");
|
||||||
go_indicator1.SetActive(true);
|
list_indicator[0].SetActive(true);
|
||||||
|
|
||||||
// 투척 지점(타겟 위치)에 인디케이터 생성, 타겟이 없으면 앞으로 5m
|
// 투척 지점(타겟 위치)에 인디케이터 생성, 타겟이 없으면 앞으로 5m
|
||||||
var targetPos = isTarget ? m_Target.Get_position() : Get_PositionFoward(5f);
|
var targetPos = isTarget ? m_Target.Get_position() : Get_PositionFoward(5f);
|
||||||
go_indicator1.transform.position = targetPos;
|
list_indicator[0].transform.position = targetPos;
|
||||||
pc_Lock.transform.position = tf_Skill1Pos.position;
|
pb_Lock.transform.position = tf_Skill1Pos.position;
|
||||||
pc_Lock.gameObject.SetActive(true);
|
pb_Lock.gameObject.SetActive(true);
|
||||||
|
|
||||||
// 투척 지점 보여준 뒤 인디케이터 끄고 던짐
|
// 투척 지점 보여준 뒤 인디케이터 끄고 던짐
|
||||||
yield return new WaitForSeconds(1f);
|
yield return new WaitForSeconds(1f);
|
||||||
go_indicator1.SetActive(false);
|
list_indicator[0].SetActive(false);
|
||||||
pc_Lock.Launch_Curved(tf_Skill1Pos.position, targetPos + Vector3.up, 1f, 7.5f, true, () =>
|
(pb_Lock as Projectile_Curved).Launch_Curved(tf_Skill1Pos.position, targetPos + Vector3.up, 1f, 7.5f, true, () =>
|
||||||
{
|
{
|
||||||
var pd = pb_LockExp.Get_ProjectTileData();
|
var pd = pb_LockExp.Get_ProjectTileData();
|
||||||
pd.LifeTime = 1f;
|
pd.LifeTime = 1f;
|
||||||
|
|
@ -95,14 +92,14 @@ public class Boss_GolemChild : BossMobActor
|
||||||
AnimationPlay("boss_skill2");
|
AnimationPlay("boss_skill2");
|
||||||
InGameInfo.Ins.Show_Effect("Effect_GolemChildSkill2", this, eEffectLocation.Bottom, Skill2ChargingTime);
|
InGameInfo.Ins.Show_Effect("Effect_GolemChildSkill2", this, eEffectLocation.Bottom, Skill2ChargingTime);
|
||||||
|
|
||||||
go_indicator2.SetActive(true);
|
list_indicator[1].SetActive(true);
|
||||||
|
|
||||||
// 투척 지점(타겟 위치)에 인디케이터 생성, 타겟이 없으면 앞으로 5m
|
// 투척 지점(타겟 위치)에 인디케이터 생성, 타겟이 없으면 앞으로 5m
|
||||||
var targetPos = isTarget ? m_Target.Get_position() : Get_PositionFoward(5f);
|
var targetPos = isTarget ? m_Target.Get_position() : Get_PositionFoward(5f);
|
||||||
go_indicator2.transform.position = targetPos;
|
list_indicator[1].transform.position = targetPos;
|
||||||
|
|
||||||
yield return new WaitForSeconds(Skill2ChargingTime);
|
yield return new WaitForSeconds(Skill2ChargingTime);
|
||||||
go_indicator2.SetActive(false);
|
list_indicator[1].SetActive(false);
|
||||||
|
|
||||||
var pd = pb_Skill2.Get_ProjectTileData();
|
var pd = pb_Skill2.Get_ProjectTileData();
|
||||||
pd.LifeTime = 1f;
|
pd.LifeTime = 1f;
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,8 @@ public class Boss_IceGolem : BossMobActor
|
||||||
public override void Set(bool isEnemy, Actor owner, ServerData sdata, int _id, bool _stop, bool _ui = false)
|
public override void Set(bool isEnemy, Actor owner, ServerData sdata, int _id, bool _stop, bool _ui = false)
|
||||||
{
|
{
|
||||||
base.Set(isEnemy, owner, sdata, _id, _stop, _ui);
|
base.Set(isEnemy, owner, sdata, _id, _stop, _ui);
|
||||||
if (DSUtil.CheckNull(go_indicator1)) IndicatorInfo.Ins.Make_Indicator(Skill1Indicator, go => { go_indicator1 = go; });
|
Load_Indicator(Skill1Indicator, 0);
|
||||||
if (DSUtil.CheckNull(go_indicator2)) IndicatorInfo.Ins.Make_Indicator(Skill2Indicator, go => { go_indicator2 = go; });
|
Load_Indicator(Skill2Indicator, 1);
|
||||||
|
|
||||||
CoolTime_Skill1 = 1f;
|
CoolTime_Skill1 = 1f;
|
||||||
CoolTime_Skill2 = 2f;
|
CoolTime_Skill2 = 2f;
|
||||||
|
|
@ -59,11 +59,11 @@ public class Boss_IceGolem : BossMobActor
|
||||||
Run_byUseSkill(Skill1TargetRange, Skill1Speed, success =>
|
Run_byUseSkill(Skill1TargetRange, Skill1Speed, success =>
|
||||||
{
|
{
|
||||||
AnimationPlay("boss_skill1start");
|
AnimationPlay("boss_skill1start");
|
||||||
go_indicator1.transform.position = Get_position();
|
list_indicator[0].transform.position = Get_position();
|
||||||
go_indicator1.SetActive(true);
|
list_indicator[0].SetActive(true);
|
||||||
Jump(0.5f, 3f, 2f, 5f, () =>
|
Jump(0.5f, 3f, 2f, 5f, () =>
|
||||||
{
|
{
|
||||||
go_indicator1.SetActive(false);
|
list_indicator[0].SetActive(false);
|
||||||
Init(true, false);
|
Init(true, false);
|
||||||
AnimationPlay("boss_skill1attack");
|
AnimationPlay("boss_skill1attack");
|
||||||
});
|
});
|
||||||
|
|
@ -78,9 +78,9 @@ public class Boss_IceGolem : BossMobActor
|
||||||
{
|
{
|
||||||
Change_MobStatus(eMobStatus.Skill);
|
Change_MobStatus(eMobStatus.Skill);
|
||||||
AnimationPlay("boss_skill2start");
|
AnimationPlay("boss_skill2start");
|
||||||
go_indicator2.SetActive(true);
|
list_indicator[1].SetActive(true);
|
||||||
go_indicator2.transform.position = Get_position();
|
list_indicator[1].transform.position = Get_position();
|
||||||
if (isTarget) go_indicator2.transform.LookAt(m_Target.transform);
|
if (isTarget) list_indicator[1].transform.LookAt(m_Target.transform);
|
||||||
|
|
||||||
float t = 0f;
|
float t = 0f;
|
||||||
while (t < 3f)
|
while (t < 3f)
|
||||||
|
|
@ -90,11 +90,11 @@ public class Boss_IceGolem : BossMobActor
|
||||||
if (isTarget)
|
if (isTarget)
|
||||||
{
|
{
|
||||||
transform.LookAt(m_Target.transform);
|
transform.LookAt(m_Target.transform);
|
||||||
go_indicator2.transform.LookAt(m_Target.transform);
|
list_indicator[1].transform.LookAt(m_Target.transform);
|
||||||
}
|
}
|
||||||
else break;
|
else break;
|
||||||
}
|
}
|
||||||
go_indicator2.SetActive(false);
|
list_indicator[1].SetActive(false);
|
||||||
|
|
||||||
if (isTarget)
|
if (isTarget)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Random = UnityEngine.Random;
|
using Random = UnityEngine.Random;
|
||||||
|
|
||||||
public class BossMobActor : MobActor
|
public class BossMobActor : MobActor
|
||||||
{
|
{
|
||||||
protected GameObject go_indicator1, go_indicator2;
|
protected List<GameObject> list_indicator = new List<GameObject>();
|
||||||
protected bool CanUseSkill1, CanUseSkill2;
|
protected bool CanUseSkill1, CanUseSkill2;
|
||||||
protected float CoolTime_PassiveSkill, CoolTime_Skill1, CoolTime_Skill2;
|
protected float CoolTime_PassiveSkill, CoolTime_Skill1, CoolTime_Skill2;
|
||||||
protected int UseSkillIndex = 0;
|
protected int UseSkillIndex = 0;
|
||||||
|
|
@ -51,8 +52,8 @@ public class BossMobActor : MobActor
|
||||||
}
|
}
|
||||||
void InActiveAllIndicator()
|
void InActiveAllIndicator()
|
||||||
{
|
{
|
||||||
if (!DSUtil.CheckNull(go_indicator1)) go_indicator1.SetActive(false);
|
for (int i = 0; i < list_indicator.Count; i++)
|
||||||
if (!DSUtil.CheckNull(go_indicator2)) go_indicator2.SetActive(false);
|
list_indicator[i].SetActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Del_Target(bool forcedel = false)
|
public override void Del_Target(bool forcedel = false)
|
||||||
|
|
@ -129,6 +130,22 @@ public class BossMobActor : MobActor
|
||||||
m_MonsterTableData.f_ProjectileLifeTime3, pb => { Set_Skill2Projectile(pb); });
|
m_MonsterTableData.f_ProjectileLifeTime3, pb => { Set_Skill2Projectile(pb); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void Load_Indicator(string prefab, int index)
|
||||||
|
{
|
||||||
|
if (list_indicator.Count <= index)
|
||||||
|
IndicatorInfo.Ins.Make_Indicator(prefab, go => { list_indicator.Add(go); go.SetActive(false); });
|
||||||
|
else
|
||||||
|
list_indicator[index].SetActive(false);
|
||||||
|
}
|
||||||
|
protected void Load_Projectile(string prefab, float skilldmg, Vector3 pos, float lifetime, ProjectileBase _pb, Action<ProjectileBase> act_pb)
|
||||||
|
{
|
||||||
|
if (DSUtil.CheckNull(_pb))
|
||||||
|
ProjectileInfo.Ins.Shoot_Projectile(prefab, this, m_Target, skilldmg, pos, lifetime,
|
||||||
|
pb => { act_pb(pb); pb.gameObject.SetActive(false); });
|
||||||
|
else
|
||||||
|
_pb.gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
|
||||||
protected void Run_byUseSkill(float range, float speed, Action<bool> moveend)
|
protected void Run_byUseSkill(float range, float speed, Action<bool> moveend)
|
||||||
{
|
{
|
||||||
StartCoroutine(Co_Run_byUseSkill(range, speed, moveend));
|
StartCoroutine(Co_Run_byUseSkill(range, speed, moveend));
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ public class MobActor : Actor
|
||||||
#endif
|
#endif
|
||||||
Set_Warp(Get_position());
|
Set_Warp(Get_position());
|
||||||
}
|
}
|
||||||
public void Set(MonsterTableData mobtable, Vector3 pos, Action<int> actDie, int order)
|
public virtual void Set(MonsterTableData mobtable, Vector3 pos, Action<int> actDie, int order)
|
||||||
{
|
{
|
||||||
m_Role = eRole.Mob;
|
m_Role = eRole.Mob;
|
||||||
m_SubRole = mobtable.e_MonsterType;
|
m_SubRole = mobtable.e_MonsterType;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue