top 이펙트 표시
This commit is contained in:
parent
aef8aa4a0f
commit
45cbfe782d
|
|
@ -29,7 +29,7 @@ public class Actor : MyCoroutine
|
||||||
public Animator m_animation;
|
public Animator m_animation;
|
||||||
protected ActorStatInfo m_Stat;
|
protected ActorStatInfo m_Stat;
|
||||||
protected double receiveaccumulateDmg, m_Damage, m_attackCoolTime; // 내가 받은 피해, 내가 준 피해, 공격 쿨타임
|
protected double receiveaccumulateDmg, m_Damage, m_attackCoolTime; // 내가 받은 피해, 내가 준 피해, 공격 쿨타임
|
||||||
protected Transform tf_HUD_HP, tf_HUD_Dmg;
|
protected Transform tf_HUD_HP, tf_HUD_Dmg, tf_Top;
|
||||||
protected Vector3 ObjSize;
|
protected Vector3 ObjSize;
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
Actor _target;
|
Actor _target;
|
||||||
|
|
@ -146,19 +146,10 @@ public class Actor : MyCoroutine
|
||||||
maxY = rendererMaxY;
|
maxY = rendererMaxY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
maxY = Mathf.Min(0.5f, maxY);
|
|
||||||
|
|
||||||
var hud_hp = new GameObject("HUD_HP");
|
Set_TF_HUD("HUD_HP", ref tf_HUD_HP, Get_position() + Vector3.down * 0.1f);
|
||||||
tf_HUD_HP = hud_hp.transform;
|
Set_TF_HUD("HUD_Dmg", ref tf_HUD_Dmg, Get_position() + Vector3.up * 0.5f);
|
||||||
tf_HUD_HP.parent = transform;
|
Set_TF_HUD("HUD_Top", ref tf_Top, new Vector3(transform.position.x, maxY, transform.position.z));
|
||||||
tf_HUD_HP.position = Get_position() + Vector3.down * 0.1f;
|
|
||||||
|
|
||||||
// maxY를 기준으로 HUD 위치 조정
|
|
||||||
Vector3 headPosition = new Vector3(transform.position.x, maxY, transform.position.z);
|
|
||||||
var hud_dmg = new GameObject("HUD_Dmg");
|
|
||||||
tf_HUD_Dmg = hud_dmg.transform;
|
|
||||||
tf_HUD_Dmg.parent = transform;
|
|
||||||
tf_HUD_Dmg.position = headPosition;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void Start()
|
protected virtual void Start()
|
||||||
|
|
@ -228,6 +219,14 @@ public class Actor : MyCoroutine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Set_TF_HUD(string goname, ref Transform tf, Vector3 pos)
|
||||||
|
{
|
||||||
|
var hud = new GameObject(goname);
|
||||||
|
tf = hud.transform;
|
||||||
|
tf.parent = transform;
|
||||||
|
tf.position = pos;
|
||||||
|
}
|
||||||
|
|
||||||
public bool isPlaying()
|
public bool isPlaying()
|
||||||
{
|
{
|
||||||
float normalizedTime = m_animation.GetCurrentAnimatorStateInfo(0).normalizedTime;
|
float normalizedTime = m_animation.GetCurrentAnimatorStateInfo(0).normalizedTime;
|
||||||
|
|
@ -835,7 +834,7 @@ public class Actor : MyCoroutine
|
||||||
{
|
{
|
||||||
return new Vector3(transform.position.x, transform.position.y + ObjSize.y * 0.5f, transform.position.z);
|
return new Vector3(transform.position.x, transform.position.y + ObjSize.y * 0.5f, transform.position.z);
|
||||||
}
|
}
|
||||||
public Vector3 Get_Top_postion() { return tf_HUD_Dmg.position; }
|
public Vector3 Get_Top_postion() { return tf_Top.position; }
|
||||||
public Vector3 Get_CenterPositionFoward(float dist = 0.3f) { return Get_Center_position() + transform.forward * dist; }
|
public Vector3 Get_CenterPositionFoward(float dist = 0.3f) { return Get_Center_position() + transform.forward * dist; }
|
||||||
public Vector3 Get_PositionFoward(float dist = 0.3f) { return Get_position() + transform.forward * dist; }
|
public Vector3 Get_PositionFoward(float dist = 0.3f) { return Get_position() + transform.forward * dist; }
|
||||||
public Vector3 Get_PositionBack(float dist = 0.3f) { return Get_position() + -transform.forward * dist; }
|
public Vector3 Get_PositionBack(float dist = 0.3f) { return Get_position() + -transform.forward * dist; }
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ public class MobActor : Actor
|
||||||
protected MonsterTableData m_MonsterTableData;
|
protected MonsterTableData m_MonsterTableData;
|
||||||
protected Dictionary<SkillListTableData, int> dic_skill = new Dictionary<SkillListTableData, int>();
|
protected Dictionary<SkillListTableData, int> dic_skill = new Dictionary<SkillListTableData, int>();
|
||||||
Action<int> m_actDie;
|
Action<int> m_actDie;
|
||||||
protected MobMark m_MobMark;
|
|
||||||
protected NoSeeLongDMob m_NoSeeLongDMob;
|
protected NoSeeLongDMob m_NoSeeLongDMob;
|
||||||
bool useMeeleAttackPos;
|
bool useMeeleAttackPos;
|
||||||
bool isNSLDMob;
|
bool isNSLDMob;
|
||||||
|
|
@ -557,13 +556,12 @@ public class MobActor : Actor
|
||||||
public override int Get_Group() { return m_SpawnerId; }
|
public override int Get_Group() { return m_SpawnerId; }
|
||||||
protected override void Set_MobMark(bool active)
|
protected override void Set_MobMark(bool active)
|
||||||
{
|
{
|
||||||
if (m_MobMark == null)
|
//if (m_MobMark == null)
|
||||||
{
|
//{
|
||||||
|
// m_MobMark = InGameInfo.Ins.Get_Obj(eObj.MobMark).GetComponent<MobMark>();
|
||||||
m_MobMark = InGameInfo.Ins.Get_Obj(eObj.MobMark).GetComponent<MobMark>();
|
// m_MobMark.transform.localScale = Vector3.one * 0.2f;
|
||||||
m_MobMark.transform.localScale = Vector3.one * 0.2f;
|
//}
|
||||||
}
|
//m_MobMark.Set(active, tf_HUD_Dmg);
|
||||||
m_MobMark.Set(active, tf_HUD_Dmg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Play_Hit()
|
public override void Play_Hit()
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using static UnityEngine.GraphicsBuffer;
|
||||||
|
|
||||||
public class Projectile_Homing : ProjectileBase
|
public class Projectile_Homing : ProjectileBase
|
||||||
{
|
{
|
||||||
|
|
@ -16,6 +17,8 @@ public class Projectile_Homing : ProjectileBase
|
||||||
IEnumerator Co_Update()
|
IEnumerator Co_Update()
|
||||||
{
|
{
|
||||||
while (m_ProjecTileData.LifeTime > 0)
|
while (m_ProjecTileData.LifeTime > 0)
|
||||||
|
{
|
||||||
|
if (m_ProjecTileData.shooter.isTarget)
|
||||||
{
|
{
|
||||||
// 목표 방향 계산
|
// 목표 방향 계산
|
||||||
Vector3 direction = (m_ProjecTileData.target.Get_Center_position() - transform.position).normalized;
|
Vector3 direction = (m_ProjecTileData.target.Get_Center_position() - transform.position).normalized;
|
||||||
|
|
@ -33,6 +36,9 @@ public class Projectile_Homing : ProjectileBase
|
||||||
|
|
||||||
m_ProjecTileData.LifeTime -= Time.deltaTime;
|
m_ProjecTileData.LifeTime -= Time.deltaTime;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
Off(true);
|
Off(true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue