Skip to content

Commit

Permalink
feat: Creature Camera가 자연스럽게 렌더링하도록 변경 & Crew 움직임 부드럽게 수정 (#24)
Browse files Browse the repository at this point in the history
* feat: Creature Camera가 자연스럽게 렌더링하도록 변경 & Crew 움직임 부드럽게 수정
  • Loading branch information
scarleter99 authored Mar 25, 2024
1 parent ff87165 commit 711214a
Show file tree
Hide file tree
Showing 17 changed files with 134 additions and 142 deletions.
12 changes: 0 additions & 12 deletions Client/Assets/Resources/Prefabs/Aliens.meta

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Transform:
m_GameObject: {fileID: 5451282063576854366}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ Animator:
m_GameObject: {fileID: 8694943018831287373}
m_Enabled: 1
m_Avatar: {fileID: 9000000, guid: 359149b95323d894b978dcd5c8770617, type: 3}
m_Controller: {fileID: 9100000, guid: cd52641d9323289498b69c8e2a93bb94, type: 2}
m_Controller: {fileID: 0}
m_CullingMode: 1
m_UpdateMode: 0
m_ApplyRootMotion: 0
Expand Down Expand Up @@ -1222,6 +1222,7 @@ MonoBehaviour:
_CreatureType: 0
_CreatureState: 0
_CreaturePose: 0
_Direction: {x: 0, y: 0, z: 0}
_Velocity: {x: 0, y: 0, z: 0}
--- !u!114 &4476358356948161216
MonoBehaviour:
Expand Down
115 changes: 49 additions & 66 deletions Client/Assets/Scenes/TestScene/Map_JSJ.unity
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 1.1140641, g: 0.8666221, b: 0.9924737, a: 1}
m_IndirectSpecularColor: {r: 1.1216449, g: 0.86481917, b: 0.96941197, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
Expand Down Expand Up @@ -1160,6 +1160,17 @@ Transform:
m_CorrespondingSourceObject: {fileID: 4275698116916540, guid: 68615fcf1489c0847af4caef5f07e486, type: 3}
m_PrefabInstance: {fileID: 160850900}
m_PrefabAsset: {fileID: 0}
--- !u!114 &188789295 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 1053169980762872978, guid: 0754c19ac0264d045a4a25cc96195ff2, type: 3}
m_PrefabInstance: {fileID: 304412822}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 506319458, guid: e725a070cec140c4caffb81624c8c787, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &200746045
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1326,17 +1337,6 @@ Transform:
m_CorrespondingSourceObject: {fileID: 4206683368507738, guid: 190104e9bd5f8014eaf9a7f5f6f7a173, type: 3}
m_PrefabInstance: {fileID: 210723653}
m_PrefabAsset: {fileID: 0}
--- !u!114 &213455147 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 1254759295562782899, guid: 7d86f0c0588612c4ca00515444f26dde, type: 3}
m_PrefabInstance: {fileID: 798304249}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a63cddc2e958b834eb28525cceb11e61, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &245682719
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1597,17 +1597,6 @@ Transform:
- {fileID: 2050875377}
m_Father: {fileID: 1820074355}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &267090137 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 62817416060429354, guid: 02871413d2295434fbaac77082fec791, type: 3}
m_PrefabInstance: {fileID: 1531932267}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a63cddc2e958b834eb28525cceb11e61, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &276561304
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -2195,6 +2184,14 @@ PrefabInstance:
propertyPath: SortKey
value: 3098027186
objectReference: {fileID: 0}
- target: {fileID: 4079248258360484710, guid: 0754c19ac0264d045a4a25cc96195ff2, type: 3}
propertyPath: NetworkedBehaviours.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4079248258360484710, guid: 0754c19ac0264d045a4a25cc96195ff2, type: 3}
propertyPath: NetworkedBehaviours.Array.data[0]
value:
objectReference: {fileID: 188789295}
- target: {fileID: 7026330786116388922, guid: 0754c19ac0264d045a4a25cc96195ff2, type: 3}
propertyPath: SortKey
value: 2789575720
Expand Down Expand Up @@ -2254,12 +2251,12 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 8649354896696592089, guid: 02871413d2295434fbaac77082fec791, type: 3}
propertyPath: NetworkedBehaviours.Array.size
value: 2
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8649354896696592089, guid: 02871413d2295434fbaac77082fec791, type: 3}
propertyPath: NetworkedBehaviours.Array.data[0]
value:
objectReference: {fileID: 610358539}
objectReference: {fileID: 610358546}
- target: {fileID: 8649354896696592089, guid: 02871413d2295434fbaac77082fec791, type: 3}
propertyPath: NetworkedBehaviours.Array.data[1]
value:
Expand Down Expand Up @@ -4409,17 +4406,6 @@ Transform:
m_CorrespondingSourceObject: {fileID: 4275698116916540, guid: 68615fcf1489c0847af4caef5f07e486, type: 3}
m_PrefabInstance: {fileID: 588029383}
m_PrefabAsset: {fileID: 0}
--- !u!114 &610358539 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 62817416060429354, guid: 02871413d2295434fbaac77082fec791, type: 3}
m_PrefabInstance: {fileID: 336117505}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a63cddc2e958b834eb28525cceb11e61, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &610358546 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 4082690056976259530, guid: 02871413d2295434fbaac77082fec791, type: 3}
Expand Down Expand Up @@ -5820,12 +5806,12 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 7619613960391375424, guid: 7d86f0c0588612c4ca00515444f26dde, type: 3}
propertyPath: NetworkedBehaviours.Array.size
value: 2
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7619613960391375424, guid: 7d86f0c0588612c4ca00515444f26dde, type: 3}
propertyPath: NetworkedBehaviours.Array.data[0]
value:
objectReference: {fileID: 213455147}
objectReference: {fileID: 1480225296}
- target: {fileID: 7619613960391375424, guid: 7d86f0c0588612c4ca00515444f26dde, type: 3}
propertyPath: NetworkedBehaviours.Array.data[1]
value:
Expand Down Expand Up @@ -6014,12 +6000,12 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 8649354896696592089, guid: 02871413d2295434fbaac77082fec791, type: 3}
propertyPath: NetworkedBehaviours.Array.size
value: 2
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8649354896696592089, guid: 02871413d2295434fbaac77082fec791, type: 3}
propertyPath: NetworkedBehaviours.Array.data[0]
value:
objectReference: {fileID: 1570584351}
objectReference: {fileID: 1570584358}
- target: {fileID: 8649354896696592089, guid: 02871413d2295434fbaac77082fec791, type: 3}
propertyPath: NetworkedBehaviours.Array.data[1]
value:
Expand Down Expand Up @@ -8443,12 +8429,12 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 7619613960391375424, guid: 7d86f0c0588612c4ca00515444f26dde, type: 3}
propertyPath: NetworkedBehaviours.Array.size
value: 2
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7619613960391375424, guid: 7d86f0c0588612c4ca00515444f26dde, type: 3}
propertyPath: NetworkedBehaviours.Array.data[0]
value:
objectReference: {fileID: 2029734270}
objectReference: {fileID: 2029734277}
- target: {fileID: 7619613960391375424, guid: 7d86f0c0588612c4ca00515444f26dde, type: 3}
propertyPath: NetworkedBehaviours.Array.data[1]
value:
Expand Down Expand Up @@ -8493,12 +8479,12 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 8649354896696592089, guid: 02871413d2295434fbaac77082fec791, type: 3}
propertyPath: NetworkedBehaviours.Array.size
value: 2
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8649354896696592089, guid: 02871413d2295434fbaac77082fec791, type: 3}
propertyPath: NetworkedBehaviours.Array.data[0]
value:
objectReference: {fileID: 267090137}
objectReference: {fileID: 1744922660}
- target: {fileID: 8649354896696592089, guid: 02871413d2295434fbaac77082fec791, type: 3}
propertyPath: NetworkedBehaviours.Array.data[1]
value:
Expand Down Expand Up @@ -8553,17 +8539,6 @@ Transform:
m_CorrespondingSourceObject: {fileID: 8871043851894611041, guid: 02871413d2295434fbaac77082fec791, type: 3}
m_PrefabInstance: {fileID: 1531932267}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1570584351 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 62817416060429354, guid: 02871413d2295434fbaac77082fec791, type: 3}
m_PrefabInstance: {fileID: 850976911}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a63cddc2e958b834eb28525cceb11e61, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1570584358 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 4082690056976259530, guid: 02871413d2295434fbaac77082fec791, type: 3}
Expand Down Expand Up @@ -8629,6 +8604,17 @@ Transform:
m_CorrespondingSourceObject: {fileID: 4206683368507738, guid: 190104e9bd5f8014eaf9a7f5f6f7a173, type: 3}
m_PrefabInstance: {fileID: 1580526793}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1582466162 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 1053169980762872978, guid: 0754c19ac0264d045a4a25cc96195ff2, type: 3}
m_PrefabInstance: {fileID: 1952821397}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 506319458, guid: e725a070cec140c4caffb81624c8c787, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &1610070490
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -10086,6 +10072,14 @@ PrefabInstance:
propertyPath: SortKey
value: 3830861132
objectReference: {fileID: 0}
- target: {fileID: 4079248258360484710, guid: 0754c19ac0264d045a4a25cc96195ff2, type: 3}
propertyPath: NetworkedBehaviours.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4079248258360484710, guid: 0754c19ac0264d045a4a25cc96195ff2, type: 3}
propertyPath: NetworkedBehaviours.Array.data[0]
value:
objectReference: {fileID: 1582466162}
- target: {fileID: 7026330786116388922, guid: 0754c19ac0264d045a4a25cc96195ff2, type: 3}
propertyPath: SortKey
value: 3522409666
Expand Down Expand Up @@ -10493,17 +10487,6 @@ Transform:
m_CorrespondingSourceObject: {fileID: 4275698116916540, guid: 68615fcf1489c0847af4caef5f07e486, type: 3}
m_PrefabInstance: {fileID: 2021528396}
m_PrefabAsset: {fileID: 0}
--- !u!114 &2029734270 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 1254759295562782899, guid: 7d86f0c0588612c4ca00515444f26dde, type: 3}
m_PrefabInstance: {fileID: 1498428100}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a63cddc2e958b834eb28525cceb11e61, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &2029734277 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 2962876028584207699, guid: 7d86f0c0588612c4ca00515444f26dde, type: 3}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ public abstract class BaseAnimController : NetworkBehaviour
public Define.CreatureState CreatureState => Creature.CreatureState;
public Define.CreaturePose CreaturePose => Creature.CreaturePose;

public float XParameter { get; protected set; }
public float ZParameter { get; protected set; }
public float SpeedParameter { get; protected set; }

public override void Spawned()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,43 +28,50 @@ protected override void PlayIdle()
break;
}

SetFloat("X", 0);
SetFloat("Z", 0);
SetFloat("SitParameter", SitParameter);
XParameter = Mathf.Lerp(XParameter, 0, Runner.DeltaTime * 5);
ZParameter = Mathf.Lerp(ZParameter, 0, Runner.DeltaTime * 5);
SpeedParameter = Mathf.Lerp(SpeedParameter, 0, Runner.DeltaTime * 5);

SetFloat("X", XParameter);
SetFloat("Z", ZParameter);
SetFloat("SitParameter", SitParameter);
SetFloat("Speed", SpeedParameter);
}

protected override void PlayMove()
{
//SetFloat("Health", CrewStat.Hp);
XParameter = Mathf.Lerp(XParameter, Creature.Direction.x, Runner.DeltaTime * 5);
ZParameter = Mathf.Lerp(ZParameter, Creature.Direction.z, Runner.DeltaTime * 5);

switch (CreaturePose)
{
case Define.CreaturePose.Stand:
SetFloat("Z", Creature.Direction.z);
SetFloat("Z", ZParameter);
SitParameter = Mathf.Lerp(SitParameter, 0, Runner.DeltaTime * 5);
SpeedParameter = Mathf.Lerp(SpeedParameter, 1f, Runner.DeltaTime * 5);
break;
case Define.CreaturePose.Sit:
SetFloat("Z", Creature.Direction.z);
SetFloat("Z", ZParameter);
SitParameter = Mathf.Lerp(SitParameter, 1, Runner.DeltaTime * 5);
SpeedParameter = Mathf.Lerp(SpeedParameter, 1, Runner.DeltaTime * 5);

break;
case Define.CreaturePose.Run:
SetFloat("Z", Creature.Direction.z * 2);
SetFloat("Z", ZParameter * 2);
SitParameter = Mathf.Lerp(SitParameter, 0, Runner.DeltaTime * 5);
SpeedParameter = Mathf.Lerp(SpeedParameter, 2, Runner.DeltaTime * 5);
break;
}

SetFloat("X", Creature.Direction.x);

SetFloat("X", XParameter);
SetFloat("SitParameter", SitParameter);
SetFloat("Speed", SpeedParameter);
}

public void PlayInteract()
{

}

public void PlayUseItem()
Expand Down
14 changes: 7 additions & 7 deletions Client/Assets/Scripts/Contents/Camera/CreatureCamera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ public void SetInfo(Creature creature)
enabled = true;
Creature = creature;

Vector3 cameraPosition;
if (Creature.CreatureType == Define.CreatureType.Crew)
cameraPosition = new Vector3(0, 1.7f, 0.13f);
else
cameraPosition = new Vector3(0, 2.8f, 0.8f);

transform.position = Creature.gameObject.transform.position + cameraPosition;
// Vector3 cameraPosition;
// if (Creature.CreatureType == Define.CreatureType.Crew)
// cameraPosition = new Vector3(0, 1.7f, 0.13f);
// else
// cameraPosition = new Vector3(0, 2.8f, 0.8f);
//
// transform.position = Creature.gameObject.transform.position + cameraPosition;
}

private void LateUpdate()
Expand Down
3 changes: 2 additions & 1 deletion Client/Assets/Scripts/Contents/Player/PlayerSpawn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
public class PlayerSpawn : SimulationBehaviour, IPlayerJoined
{
public GameObject[] PlayerPrefab;
public int PrefabNum;
public Vector3 PlayerSpawnPosition;
public void PlayerJoined(PlayerRef player)
{
if (player == Runner.LocalPlayer)
{
NetworkObject no = Runner.Spawn(PlayerPrefab[0], PlayerSpawnPosition, Quaternion.identity);
NetworkObject no = Runner.Spawn(PlayerPrefab[PrefabNum], PlayerSpawnPosition, Quaternion.identity);
Creature creature = no.GetComponent<Creature>();
if (creature is Crew)
{
Expand Down
Loading

0 comments on commit 711214a

Please sign in to comment.