Skip to content

Commit

Permalink
PlayerLoadedEvent now properly received. Camera now moves correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuskilian committed Apr 30, 2020
1 parent af9a567 commit 39113b8
Show file tree
Hide file tree
Showing 30 changed files with 106 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Assets/Data/Game Modes/Classic.asset
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ MonoBehaviour:
array2D:
- row:
- active: 1
shared: 0
shared: 1
- active: 1
shared: 0
shared: 1
- active: 1
shared: 0
- row:
Expand Down
96 changes: 95 additions & 1 deletion Assets/Prefabs/Player.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ Transform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Children:
- {fileID: 666830436923225520}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand Down Expand Up @@ -74,3 +75,96 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
PlayerID: 0
--- !u!1 &1915322147054204024
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 666830436923225520}
- component: {fileID: 7541935603408639585}
- component: {fileID: 8160181856423048715}
- component: {fileID: 5516178576142883038}
m_Layer: 0
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &666830436923225520
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1915322147054204024}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1.39, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1660498949091557803}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &7541935603408639585
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1915322147054204024}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &8160181856423048715
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1915322147054204024}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!65 &5516178576142883038
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1915322147054204024}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
4 changes: 2 additions & 2 deletions Assets/Scenes/Ingame.unity
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 446054964}
m_LocalRotation: {x: 0.4028585, y: 0, z: 0, w: 0.9152623}
m_LocalPosition: {x: 10, y: 7.275, z: 0.193}
m_LocalPosition: {x: 10, y: 7.275, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 2088224693}
Expand Down Expand Up @@ -344,7 +344,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d42f4b990490f7c46b9fdf3937fe987a, type: 3}
m_Name:
m_EditorClassIdentifier:
CamOffset: {x: 10, y: 7.275, z: 0.193}
CamOffset: {x: 5, y: 7.275, z: 0}
CamRotationEulers: {x: 30, y: 0, z: 0}
--- !u!1 &1558936934
GameObject:
Expand Down
7 changes: 3 additions & 4 deletions Assets/Scripts/Client/CameraMan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ public class CameraMan : GlobalEventListener {

public Vector3 CamOffset;
public Vector3 CamRotationEulers;

public override void OnEvent(PlayerSpawnedEvent evnt) {
BoltLog.Info("PLAYERRRRR" + evnt.PlayerNetID);
var playerEntity = BoltNetwork.FindEntity(evnt.PlayerNetID);
transform.SetParent(playerEntity.transform.parent);
transform.SetParent(playerEntity.transform);
transform.localPosition = CamOffset;
transform.localRotation = Quaternion.Euler(CamRotationEulers);
}

}
2 changes: 1 addition & 1 deletion Assets/Scripts/Other/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ private void ResetPosition() {
transform.localPosition = Vector3.zero;
transform.localRotation = Quaternion.identity;
}
}
}
2 changes: 1 addition & 1 deletion Assets/Scripts/Server/Singleton/GameMan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public override void SceneLoadLocalDone(string scene, IProtocolToken token) {
GameLoadedEvent?.Invoke();
}

public override void Connected(BoltConnection connection) {
public override void SceneLoadRemoteDone(BoltConnection connection, IProtocolToken token) {
InitPlayer(connection);
}

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
player-connection-mode=Listen
player-connection-guid=2513426257
player-connection-guid=507452043
player-connection-debug=0
player-connection-project-name=Poke-Arena URP
player-connection-ip=192.168.2.122
Expand Down
Binary file modified Bolt_DebugStart_Build/Bolt_DebugStart_Build_Data/globalgamemanagers
Binary file not shown.
Binary file modified Bolt_DebugStart_Build/Bolt_DebugStart_Build_Data/level1
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ PlayerSettings:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
metroInputSource: 0
wsaTransparentSwapchain: 0
m_HolographicPauseOnTrackingLoss: 1
Expand Down

0 comments on commit 39113b8

Please sign in to comment.