카메라 타겟 고정, 씬 이동 시 투사체 모두 끄기
This commit is contained in:
parent
518363365c
commit
bc2367a27b
|
|
@ -30,8 +30,6 @@ classconfig 에 의해 정해짐
|
||||||
- 기본 공속
|
- 기본 공속
|
||||||
- 기본 이속
|
- 기본 이속
|
||||||
- PC 장비 (현재 2종만 적용)
|
- PC 장비 (현재 2종만 적용)
|
||||||
상태 이상 ui 표시
|
|
||||||
- https://www.notion.so/devlucas/c4dc5df0d9d64c95963c6e540acdca7c#e3ef07bc84ff424790bb723835bbce87
|
|
||||||
|
|
||||||
장비 스탯 추가 구현
|
장비 스탯 추가 구현
|
||||||
- 일꾼 이속, RND_SKILL
|
- 일꾼 이속, RND_SKILL
|
||||||
|
|
@ -64,6 +62,9 @@ messageinfo 엄청 느린 버그
|
||||||
- 몬스터 패트롤 거리 조절
|
- 몬스터 패트롤 거리 조절
|
||||||
- 점수와 골드 (기본 1점, 10골드만 주는 중(밸런스 필요))
|
- 점수와 골드 (기본 1점, 10골드만 주는 중(밸런스 필요))
|
||||||
|
|
||||||
타겟 락 시 카메라 타겟에게 고정
|
상태 이상 ui 표시
|
||||||
로딩 UI
|
- https://www.notion.so/devlucas/c4dc5df0d9d64c95963c6e540acdca7c#e3ef07bc84ff424790bb723835bbce87
|
||||||
|
|
||||||
|
hud 이상 수정
|
||||||
|
타겟 락 시 카메라 타겟에게 고정
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2063,7 +2063,7 @@ public class Actor : MyCoroutine
|
||||||
}
|
}
|
||||||
protected void Shoot_Projectile(string proj, float lifetime, Vector3 startpos)
|
protected void Shoot_Projectile(string proj, float lifetime, Vector3 startpos)
|
||||||
{
|
{
|
||||||
if (ProjectileInfo.ProjectileInfoOn)
|
if (ProjectileInfo.isIns)
|
||||||
{
|
{
|
||||||
var ccData = Get_CCData(eCC.MultiShot);
|
var ccData = Get_CCData(eCC.MultiShot);
|
||||||
var amount = 1 + (ccData.CCTime > 0f ? ccData.CCVal : 0);
|
var amount = 1 + (ccData.CCTime > 0f ? ccData.CCVal : 0);
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,7 @@ public class BossMobActor : MobActor
|
||||||
protected virtual void Set_Skill1Projectile(ProjectileBase pb) { }
|
protected virtual void Set_Skill1Projectile(ProjectileBase pb) { }
|
||||||
protected virtual void BossProjectile2(string s)
|
protected virtual void BossProjectile2(string s)
|
||||||
{
|
{
|
||||||
if (ProjectileInfo.ProjectileInfoOn)
|
if (ProjectileInfo.isIns)
|
||||||
ProjectileInfo.Ins.Shoot_Projectile(m_MonsterTableData.s_Porjectile2, this, m_Target, Get_Skill1Dmg(), Get_Skill1Pos(),
|
ProjectileInfo.Ins.Shoot_Projectile(m_MonsterTableData.s_Porjectile2, this, m_Target, Get_Skill1Dmg(), Get_Skill1Pos(),
|
||||||
m_MonsterTableData.f_ProjectileLifeTime2, pb => { Set_Skill1Projectile(pb); });
|
m_MonsterTableData.f_ProjectileLifeTime2, pb => { Set_Skill1Projectile(pb); });
|
||||||
}
|
}
|
||||||
|
|
@ -126,7 +126,7 @@ public class BossMobActor : MobActor
|
||||||
protected virtual void Set_Skill2Projectile(ProjectileBase pb) { }
|
protected virtual void Set_Skill2Projectile(ProjectileBase pb) { }
|
||||||
protected virtual void BossProjectile3(string s)
|
protected virtual void BossProjectile3(string s)
|
||||||
{
|
{
|
||||||
if (ProjectileInfo.ProjectileInfoOn)
|
if (ProjectileInfo.isIns)
|
||||||
ProjectileInfo.Ins.Shoot_Projectile(m_MonsterTableData.s_Porjectile3, this, m_Target, Get_Skill2Dmg(), Get_Skill2Pos(),
|
ProjectileInfo.Ins.Shoot_Projectile(m_MonsterTableData.s_Porjectile3, this, m_Target, Get_Skill2Dmg(), Get_Skill2Pos(),
|
||||||
m_MonsterTableData.f_ProjectileLifeTime3, pb => { Set_Skill2Projectile(pb); });
|
m_MonsterTableData.f_ProjectileLifeTime3, pb => { Set_Skill2Projectile(pb); });
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -600,7 +600,7 @@ public class MobActor : Actor
|
||||||
public override void Projectile(string s)
|
public override void Projectile(string s)
|
||||||
{
|
{
|
||||||
base.Projectile(s);
|
base.Projectile(s);
|
||||||
if (ProjectileInfo.ProjectileInfoOn)
|
if (ProjectileInfo.isIns)
|
||||||
{
|
{
|
||||||
if (m_MonsterTableData.n_PassiveSkillID > 0)
|
if (m_MonsterTableData.n_PassiveSkillID > 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -457,6 +457,7 @@ public class PCActor : MyActor
|
||||||
ActorInfo.Ins.All_Stop(true);
|
ActorInfo.Ins.All_Stop(true);
|
||||||
NewGameUI.Ins.m_GuideQuestUI.Add_GuideQuest(ePurpose.DieOrQuit);
|
NewGameUI.Ins.m_GuideQuestUI.Add_GuideQuest(ePurpose.DieOrQuit);
|
||||||
DungeonInfo.Ins.Sub_WaveLife();
|
DungeonInfo.Ins.Sub_WaveLife();
|
||||||
|
MonsterSimpleInfo.Ins.Set_DelLockTarget(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override IEnumerator Co_ScaleControl(bool returntoOriginalScale, float targetscale, Action actComplete = null)
|
protected override IEnumerator Co_ScaleControl(bool returntoOriginalScale, float targetscale, Action actComplete = null)
|
||||||
|
|
|
||||||
|
|
@ -163,6 +163,7 @@ public partial class InGameInfo : MyCoroutine
|
||||||
public void Load_Map(int id)
|
public void Load_Map(int id)
|
||||||
{
|
{
|
||||||
AllEffectOff();
|
AllEffectOff();
|
||||||
|
if (ProjectileInfo.isIns) ProjectileInfo.Ins.AllOff();
|
||||||
MyValue.MyChoiceMapData.n_MapID = id;
|
MyValue.MyChoiceMapData.n_MapID = id;
|
||||||
var Tdata = table_battlemapconfig.Ins.Get_Data(MyValue.MyChoiceMapData.n_MapID);
|
var Tdata = table_battlemapconfig.Ins.Get_Data(MyValue.MyChoiceMapData.n_MapID);
|
||||||
m_GameMode = Tdata.e_MapType;
|
m_GameMode = Tdata.e_MapType;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ using UnityEngine;
|
||||||
|
|
||||||
public class ProjectileInfo : MonoBehaviour
|
public class ProjectileInfo : MonoBehaviour
|
||||||
{
|
{
|
||||||
public static bool ProjectileInfoOn = false;
|
public static bool isIns = false;
|
||||||
public static ProjectileInfo Ins;
|
public static ProjectileInfo Ins;
|
||||||
|
|
||||||
public Material[] arr_materials; // 0 얼음, 1 히트
|
public Material[] arr_materials; // 0 얼음, 1 히트
|
||||||
|
|
@ -18,7 +18,14 @@ public class ProjectileInfo : MonoBehaviour
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
Ins = this;
|
Ins = this;
|
||||||
ProjectileInfoOn = true;
|
isIns = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AllOff()
|
||||||
|
{
|
||||||
|
foreach (var projectileList in dic_projectile.Values)
|
||||||
|
foreach (var projectile in projectileList)
|
||||||
|
projectile.gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerator Start()
|
IEnumerator Start()
|
||||||
|
|
|
||||||
|
|
@ -10,17 +10,19 @@ public class MonsterSimpleInfo : MonoBehaviourSingletonTemplate<MonsterSimpleInf
|
||||||
public TextMeshProUGUI[] labels; // 0 레벨
|
public TextMeshProUGUI[] labels; // 0 레벨
|
||||||
public Slider slider_hp;
|
public Slider slider_hp;
|
||||||
|
|
||||||
|
bool isActor;
|
||||||
Actor m_Actor;
|
Actor m_Actor;
|
||||||
|
|
||||||
private void Start() { Off(); }
|
private void Start() { Off(); }
|
||||||
public void Off() { go_child.SetActive(false); m_Actor = null; }
|
public void Off() { go_child.SetActive(false); m_Actor = null; isActor = false; }
|
||||||
|
|
||||||
public void Set(Actor actor)
|
public void Set(Actor actor)
|
||||||
{
|
{
|
||||||
if (!DSUtil.CheckNull(m_Actor) && m_Actor.m_IsLockTarget) return;
|
if (isActor && m_Actor.m_IsLockTarget) return;
|
||||||
|
|
||||||
go_child.SetActive(true);
|
go_child.SetActive(true);
|
||||||
m_Actor = actor;
|
m_Actor = actor;
|
||||||
|
isActor = true;
|
||||||
|
|
||||||
go_boss.SetActive(m_Actor.IsSubRole(eSubRol.Boss));
|
go_boss.SetActive(m_Actor.IsSubRole(eSubRol.Boss));
|
||||||
//sprites[0].spriteName = ""; // TODO 정인호 : 몹 얼굴 없음
|
//sprites[0].spriteName = ""; // TODO 정인호 : 몹 얼굴 없음
|
||||||
|
|
@ -32,13 +34,21 @@ public class MonsterSimpleInfo : MonoBehaviourSingletonTemplate<MonsterSimpleInf
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
if (!DSUtil.CheckNull(m_Actor))
|
if (isActor) slider_hp.value = (float)(m_Actor.Get_HP() / m_Actor.Get_MaxHP());
|
||||||
slider_hp.value = (float)(m_Actor.Get_HP() / m_Actor.Get_MaxHP());
|
}
|
||||||
|
|
||||||
|
public void Set_DelLockTarget(bool isDead)
|
||||||
|
{
|
||||||
|
sprites[1].canvasRenderer.SetAlpha(0.25f);
|
||||||
|
m_Actor.m_IsLockTarget = false;
|
||||||
|
MyValue.MyPC.Del_Target();
|
||||||
|
MyValue.m_RealCamera.Set_LockTarget(null);
|
||||||
|
if (isDead) Off();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnClick_Lock()
|
public void OnClick_Lock()
|
||||||
{
|
{
|
||||||
if (!DSUtil.CheckNull(m_Actor))
|
if (isActor)
|
||||||
{
|
{
|
||||||
m_Actor.m_IsLockTarget = !m_Actor.m_IsLockTarget;
|
m_Actor.m_IsLockTarget = !m_Actor.m_IsLockTarget;
|
||||||
|
|
||||||
|
|
@ -46,22 +56,16 @@ public class MonsterSimpleInfo : MonoBehaviourSingletonTemplate<MonsterSimpleInf
|
||||||
{
|
{
|
||||||
sprites[1].canvasRenderer.SetAlpha(1f);
|
sprites[1].canvasRenderer.SetAlpha(1f);
|
||||||
MyValue.MyPC.Change_Target(true, m_Actor);
|
MyValue.MyPC.Change_Target(true, m_Actor);
|
||||||
|
MyValue.m_RealCamera.Set_LockTarget(m_Actor.transform);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
Set_DelLockTarget(false);
|
||||||
sprites[1].canvasRenderer.SetAlpha(0.25f);
|
|
||||||
MyValue.MyPC.Del_Target();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnClick_Close()
|
public void OnClick_Close()
|
||||||
{
|
{
|
||||||
if (!DSUtil.CheckNull(m_Actor))
|
if (isActor) Set_DelLockTarget(false);
|
||||||
{
|
|
||||||
m_Actor.m_IsLockTarget = false;
|
|
||||||
MyValue.MyPC.Del_Target();
|
|
||||||
}
|
|
||||||
Off();
|
Off();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using static UnityEngine.GraphicsBuffer;
|
||||||
|
|
||||||
public class RealCamera : MyCoroutine
|
public class RealCamera : MyCoroutine
|
||||||
{
|
{
|
||||||
|
|
@ -42,6 +43,9 @@ public class RealCamera : MyCoroutine
|
||||||
GameObject godummy, gowitch;
|
GameObject godummy, gowitch;
|
||||||
List<Transform> list_tfCamactionTarget = new List<Transform>();
|
List<Transform> list_tfCamactionTarget = new List<Transform>();
|
||||||
|
|
||||||
|
bool islockTarget;
|
||||||
|
Transform tf_lockTarget;
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
OriminDistance = minDistance;
|
OriminDistance = minDistance;
|
||||||
|
|
@ -91,16 +95,25 @@ public class RealCamera : MyCoroutine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void Add_CamActionTarget(Transform _target) { list_tfCamactionTarget.Add(_target); }
|
public void Add_CamActionTarget(Transform _target) { list_tfCamactionTarget.Add(_target); }
|
||||||
|
public void Set_LockTarget(Transform locktarget)
|
||||||
|
{
|
||||||
|
tf_lockTarget = locktarget;
|
||||||
|
islockTarget = tf_lockTarget;
|
||||||
|
}
|
||||||
public void Set_TargetShow(Transform _target)
|
public void Set_TargetShow(Transform _target)
|
||||||
{
|
{
|
||||||
if (CamStatus != 0 && isTarget)
|
if (CamStatus != 0 && isTarget)
|
||||||
{
|
{
|
||||||
// 매개변수 타겟을 보게 카메라 회전
|
// 매개변수 타겟을 보게 카메라 회전
|
||||||
|
Set_CamDummy(_target);
|
||||||
|
Set_Coroutine(() => { rotateAround = godummy.transform.eulerAngles.y - 45f; }, 0.1f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void Set_CamDummy(Transform _target)
|
||||||
|
{
|
||||||
if (godummy == null) godummy = new GameObject("CamDummy");
|
if (godummy == null) godummy = new GameObject("CamDummy");
|
||||||
godummy.transform.position = target.position;
|
godummy.transform.position = target.position;
|
||||||
godummy.transform.LookAt(_target);
|
godummy.transform.LookAt(_target);
|
||||||
Set_Coroutine(() => { rotateAround = godummy.transform.eulerAngles.y - 45f; }, 0.1f);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public void Set_Axis(bool _horizontal, float _value)
|
public void Set_Axis(bool _horizontal, float _value)
|
||||||
{
|
{
|
||||||
|
|
@ -184,43 +197,37 @@ public class RealCamera : MyCoroutine
|
||||||
|
|
||||||
void Update_Cam()
|
void Update_Cam()
|
||||||
{
|
{
|
||||||
//Offset of the targets transform (Since the pivot point is usually at the feet).
|
|
||||||
Vector3 targetOffset = target.position;
|
Vector3 targetOffset = target.position;
|
||||||
Quaternion rotation = Quaternion.Euler(cameraHeight, rotateAround, cameraPan);
|
Quaternion rotation = Quaternion.Euler(cameraHeight, rotateAround, cameraPan);
|
||||||
Vector3 vectorMask = Vector3.one;
|
Vector3 vectorMask = Vector3.one;
|
||||||
Vector3 rotateVector = rotation * vectorMask;
|
Vector3 rotateVector = rotation * vectorMask;
|
||||||
//this determines where both the camera and it's mask will be.
|
|
||||||
//the camMask is for forcing the camera to push away from walls.
|
|
||||||
camPosition = targetOffset + Vector3.up * DistanceUp - rotateVector * DistanceAway;
|
camPosition = targetOffset + Vector3.up * DistanceUp - rotateVector * DistanceAway;
|
||||||
camMask = targetOffset + Vector3.up * DistanceUp - rotateVector * DistanceAway;
|
camMask = targetOffset + Vector3.up * DistanceUp - rotateVector * DistanceAway;
|
||||||
|
|
||||||
//occludeRay(ref targetOffset);
|
//occludeRay(ref targetOffset);
|
||||||
transform.position = Vector3.Lerp(transform.position, camPosition, Time.deltaTime * smooth);
|
transform.position = Vector3.Lerp(transform.position, camPosition, Time.deltaTime * smooth);
|
||||||
|
|
||||||
if (m_BackMove)
|
if (m_BackMove)
|
||||||
{
|
{
|
||||||
Vector3 backOffsetDirection = -transform.forward.normalized * m_BackOffSet.z;
|
Vector3 backOffsetDirection = -transform.forward.normalized * m_BackOffSet.z;
|
||||||
transform.position += new Vector3(backOffsetDirection.x, 0f, backOffsetDirection.z);
|
transform.position += new Vector3(backOffsetDirection.x, 0f, backOffsetDirection.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (islockTarget)
|
||||||
|
{
|
||||||
|
Set_CamDummy(tf_lockTarget);
|
||||||
|
rotateAround = godummy.transform.eulerAngles.y - 45f;
|
||||||
|
}
|
||||||
|
|
||||||
transform.LookAt(target.position + m_LookAt);
|
transform.LookAt(target.position + m_LookAt);
|
||||||
|
|
||||||
#region wrap the cam orbit rotation
|
#region wrap the cam orbit rotation
|
||||||
if (rotateAround > 360)
|
if (rotateAround > 360) rotateAround = 0f;
|
||||||
{
|
else if (rotateAround < 0f) rotateAround += 360f;
|
||||||
rotateAround = 0f;
|
|
||||||
}
|
|
||||||
else if (rotateAround < 0f)
|
|
||||||
{
|
|
||||||
rotateAround = (rotateAround + 360f);
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
rotateAround += HorizontalAxis * camRotateSpeed * Time.deltaTime;
|
rotateAround += HorizontalAxis * camRotateSpeed * Time.deltaTime;
|
||||||
|
|
||||||
|
|
||||||
//rotateAround = 145;
|
|
||||||
|
|
||||||
|
|
||||||
if (HorizontalAxis >= -0.1f || HorizontalAxis <= 0.1f) HorizontalAxis = 0f;
|
if (HorizontalAxis >= -0.1f || HorizontalAxis <= 0.1f) HorizontalAxis = 0f;
|
||||||
//DistanceUp = Mathf.Clamp(DistanceUp += VerticalAxis, -0.79f, 2.3f);
|
//DistanceUp = Mathf.Clamp(DistanceUp += VerticalAxis, -0.79f, 2.3f);
|
||||||
DistanceAway = Mathf.Clamp(DistanceAway += VerticalAxis, minDistance, maxDistance);
|
DistanceAway = Mathf.Clamp(DistanceAway += VerticalAxis, minDistance, maxDistance);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue