Commit f6ed3c6f authored by cann-alberto's avatar cann-alberto
Browse files

first project commit

parent 4487b14f
fileFormatVersion: 2
guid: 91c0fa5f4542be14dbad5c838292056b
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 112000000, guid: 9cf316d2721ad3840acdd6e92be52437,
type: 2}
m_UseShadowmask: 1
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1001 &571924470
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1098173225717622921, guid: c624c75494b4d7d4086b9212f897e56a,
type: 3}
propertyPath: m_RootOrder
value: 3
objectReference: {fileID: 0}
- target: {fileID: 1098173225717622921, guid: c624c75494b4d7d4086b9212f897e56a,
type: 3}
propertyPath: m_LocalPosition.x
value: 10
objectReference: {fileID: 0}
- target: {fileID: 1098173225717622921, guid: c624c75494b4d7d4086b9212f897e56a,
type: 3}
propertyPath: m_LocalPosition.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1098173225717622921, guid: c624c75494b4d7d4086b9212f897e56a,
type: 3}
propertyPath: m_LocalPosition.z
value: -10
objectReference: {fileID: 0}
- target: {fileID: 1098173225717622921, guid: c624c75494b4d7d4086b9212f897e56a,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1098173225717622921, guid: c624c75494b4d7d4086b9212f897e56a,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1098173225717622921, guid: c624c75494b4d7d4086b9212f897e56a,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1098173225717622921, guid: c624c75494b4d7d4086b9212f897e56a,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1098173225717622921, guid: c624c75494b4d7d4086b9212f897e56a,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1098173225717622921, guid: c624c75494b4d7d4086b9212f897e56a,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1098173225717622921, guid: c624c75494b4d7d4086b9212f897e56a,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1098173225717622925, guid: c624c75494b4d7d4086b9212f897e56a,
type: 3}
propertyPath: m_Name
value: Portal
objectReference: {fileID: 0}
- target: {fileID: 3141292696673982546, guid: c624c75494b4d7d4086b9212f897e56a,
type: 3}
propertyPath: sceneId
value: 1073849646
objectReference: {fileID: 0}
- target: {fileID: 3141292696673982546, guid: c624c75494b4d7d4086b9212f897e56a,
type: 3}
propertyPath: serverOnly
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5948271423698091598, guid: c624c75494b4d7d4086b9212f897e56a,
type: 3}
propertyPath: originScene
value: Assets/DungeonTest/Scenes/Level2.unity
objectReference: {fileID: 0}
- target: {fileID: 5948271423698091598, guid: c624c75494b4d7d4086b9212f897e56a,
type: 3}
propertyPath: startPosition.x
value: 5
objectReference: {fileID: 0}
- target: {fileID: 5948271423698091598, guid: c624c75494b4d7d4086b9212f897e56a,
type: 3}
propertyPath: startPosition.y
value: 1.1
objectReference: {fileID: 0}
- target: {fileID: 5948271423698091598, guid: c624c75494b4d7d4086b9212f897e56a,
type: 3}
propertyPath: startPosition.z
value: -10
objectReference: {fileID: 0}
- target: {fileID: 5948271423698091598, guid: c624c75494b4d7d4086b9212f897e56a,
type: 3}
propertyPath: destinationScene
value: Assets/Mirror/Examples/AdditiveLevels/Scenes/MirrorAdditiveLevelsSubLevel1.unity
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c624c75494b4d7d4086b9212f897e56a, type: 3}
--- !u!1001 &1071886463
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1514693545}
m_Modifications:
- target: {fileID: -5172514306435102607, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: sceneId
value: 2068572849
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_RootOrder
value: 3
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalPosition.x
value: 5
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalPosition.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236743, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_Name
value: Sphere
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e588080aa542be54d9ca9d5c734dc9ee, type: 3}
--- !u!4 &1071886464 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
m_PrefabInstance: {fileID: 1071886463}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1294796098
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1514693545}
m_Modifications:
- target: {fileID: -5172514306435102607, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: sceneId
value: 131067959
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalPosition.x
value: -3
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalPosition.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236743, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_Name
value: Sphere
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e588080aa542be54d9ca9d5c734dc9ee, type: 3}
--- !u!4 &1294796099 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
m_PrefabInstance: {fileID: 1294796098}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1333422873
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 440985591853936351, guid: 99d75386017b4ba44ad1482ee7938f5a,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 440985591853936351, guid: 99d75386017b4ba44ad1482ee7938f5a,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 440985591853936351, guid: 99d75386017b4ba44ad1482ee7938f5a,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 440985591853936351, guid: 99d75386017b4ba44ad1482ee7938f5a,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 440985591853936351, guid: 99d75386017b4ba44ad1482ee7938f5a,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 440985591853936351, guid: 99d75386017b4ba44ad1482ee7938f5a,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 440985591853936351, guid: 99d75386017b4ba44ad1482ee7938f5a,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 440985591853936351, guid: 99d75386017b4ba44ad1482ee7938f5a,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 440985591853936351, guid: 99d75386017b4ba44ad1482ee7938f5a,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 440985591853936351, guid: 99d75386017b4ba44ad1482ee7938f5a,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2581897434666803994, guid: 99d75386017b4ba44ad1482ee7938f5a,
type: 3}
propertyPath: m_Name
value: PhysicsSimulator
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 99d75386017b4ba44ad1482ee7938f5a, type: 3}
--- !u!1 &1514693544
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1514693545}
m_Layer: 0
m_Name: Spheres
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1514693545
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1514693544}
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:
- {fileID: 2188792038635513490}
- {fileID: 1294796099}
- {fileID: 2120764046}
- {fileID: 1071886464}
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1932534637
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1932534639}
- component: {fileID: 1932534638}
m_Layer: 0
m_Name: Environment
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1932534638
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1932534637}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9b91ecbcc199f4492b9a91e820070131, type: 3}
m_Name:
m_EditorClassIdentifier:
clientStarted: 0
sceneId: 159404139
_assetId: 0
serverOnly: 0
visible: 0
hasSpawned: 0
--- !u!4 &1932534639
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1932534637}
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:
- {fileID: 6358973573665600640}
- {fileID: 1999985658}
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1999985657
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1932534639}
m_Modifications:
- target: {fileID: 7582855647636897216, guid: 849c125c9d8094249b3c664da1cd143a,
type: 3}
propertyPath: m_Name
value: StartPoint
objectReference: {fileID: 0}
- target: {fileID: 7582855647636897223, guid: 849c125c9d8094249b3c664da1cd143a,
type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7582855647636897223, guid: 849c125c9d8094249b3c664da1cd143a,
type: 3}
propertyPath: m_LocalPosition.x
value: -5
objectReference: {fileID: 0}
- target: {fileID: 7582855647636897223, guid: 849c125c9d8094249b3c664da1cd143a,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7582855647636897223, guid: 849c125c9d8094249b3c664da1cd143a,
type: 3}
propertyPath: m_LocalPosition.z
value: 10
objectReference: {fileID: 0}
- target: {fileID: 7582855647636897223, guid: 849c125c9d8094249b3c664da1cd143a,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7582855647636897223, guid: 849c125c9d8094249b3c664da1cd143a,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7582855647636897223, guid: 849c125c9d8094249b3c664da1cd143a,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7582855647636897223, guid: 849c125c9d8094249b3c664da1cd143a,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7582855647636897223, guid: 849c125c9d8094249b3c664da1cd143a,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7582855647636897223, guid: 849c125c9d8094249b3c664da1cd143a,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7582855647636897223, guid: 849c125c9d8094249b3c664da1cd143a,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 849c125c9d8094249b3c664da1cd143a, type: 3}
--- !u!4 &1999985658 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7582855647636897223, guid: 849c125c9d8094249b3c664da1cd143a,
type: 3}
m_PrefabInstance: {fileID: 1999985657}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &2120764045
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1514693545}
m_Modifications:
- target: {fileID: -5172514306435102607, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: sceneId
value: 1581864539
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalPosition.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalPosition.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236743, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_Name
value: Sphere
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e588080aa542be54d9ca9d5c734dc9ee, type: 3}
--- !u!4 &2120764046 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
m_PrefabInstance: {fileID: 2120764045}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &2188792038635513489
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1514693545}
m_Modifications:
- target: {fileID: -5172514306435102607, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: sceneId
value: 3873206969
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalPosition.x
value: -7
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalPosition.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2188792038427236743, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
propertyPath: m_Name
value: Sphere
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e588080aa542be54d9ca9d5c734dc9ee, type: 3}
--- !u!4 &2188792038635513490 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 2188792038427236742, guid: e588080aa542be54d9ca9d5c734dc9ee,
type: 3}
m_PrefabInstance: {fileID: 2188792038635513489}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &6358973573665600639
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1932534639}
m_Modifications:
- target: {fileID: 7349408984269008052, guid: 4fdcc4aa5c669b348a5954a92f5e8e89,
type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7349408984269008052, guid: 4fdcc4aa5c669b348a5954a92f5e8e89,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7349408984269008052, guid: 4fdcc4aa5c669b348a5954a92f5e8e89,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7349408984269008052, guid: 4fdcc4aa5c669b348a5954a92f5e8e89,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7349408984269008052, guid: 4fdcc4aa5c669b348a5954a92f5e8e89,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7349408984269008052, guid: 4fdcc4aa5c669b348a5954a92f5e8e89,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7349408984269008052, guid: 4fdcc4aa5c669b348a5954a92f5e8e89,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7349408984269008052, guid: 4fdcc4aa5c669b348a5954a92f5e8e89,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7349408984269008052, guid: 4fdcc4aa5c669b348a5954a92f5e8e89,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7349408984269008052, guid: 4fdcc4aa5c669b348a5954a92f5e8e89,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7349408984269008052, guid: 4fdcc4aa5c669b348a5954a92f5e8e89,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7349408984269008055, guid: 4fdcc4aa5c669b348a5954a92f5e8e89,
type: 3}
propertyPath: m_Name
value: Plane
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 4fdcc4aa5c669b348a5954a92f5e8e89, type: 3}
--- !u!4 &6358973573665600640 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7349408984269008052, guid: 4fdcc4aa5c669b348a5954a92f5e8e89,
type: 3}
m_PrefabInstance: {fileID: 6358973573665600639}
m_PrefabAsset: {fileID: 0}
fileFormatVersion: 2
guid: e8e2dc8c3ef824b468c6f6e1980a4b27
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: daf19edd647d8ae4ead9cb46f24f5424
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using UnityEngine;
using UnityEngine.SceneManagement;
namespace Mirror.Examples.AdditiveLevels
{
[AddComponentMenu("")]
public class AdditiveLevelsNetworkManager : NetworkManager
{
public static new AdditiveLevelsNetworkManager singleton => (AdditiveLevelsNetworkManager)NetworkManager.singleton;
[Header("Additive Scenes - First is start scene")]
[Scene, Tooltip("Add additive scenes here.\nFirst entry will be players' start scene")]
public string[] additiveScenes;
[Header("Fade Control - See child FadeCanvas")]
[Tooltip("Reference to FadeInOut script on child FadeCanvas")]
public FadeInOut fadeInOut;
// This is set true after server loads all subscene instances
bool subscenesLoaded;
// This is managed in LoadAdditive, UnloadAdditive, and checked in OnClientSceneChanged
bool isInTransition;
#region Scene Management
/// <summary>
/// Called on the server when a scene is completed loaded, when the scene load was initiated by the server with ServerChangeScene().
/// </summary>
/// <param name="sceneName">The name of the new scene.</param>
public override void OnServerSceneChanged(string sceneName)
{
// This fires after server fully changes scenes, e.g. offline to online
// If server has just loaded the Container (online) scene, load the subscenes on server
if (sceneName == onlineScene)
StartCoroutine(ServerLoadSubScenes());
}
IEnumerator ServerLoadSubScenes()
{
foreach (string additiveScene in additiveScenes)
yield return SceneManager.LoadSceneAsync(additiveScene, new LoadSceneParameters
{
loadSceneMode = LoadSceneMode.Additive,
localPhysicsMode = LocalPhysicsMode.Physics3D // change this to .Physics2D for a 2D game
});
subscenesLoaded = true;
}
/// <summary>
/// Called from ClientChangeScene immediately before SceneManager.LoadSceneAsync is executed
/// <para>This allows client to do work / cleanup / prep before the scene changes.</para>
/// </summary>
/// <param name="sceneName">Name of the scene that's about to be loaded</param>
/// <param name="sceneOperation">Scene operation that's about to happen</param>
/// <param name="customHandling">true to indicate that scene loading will be handled through overrides</param>
public override void OnClientChangeScene(string sceneName, SceneOperation sceneOperation, bool customHandling)
{
//Debug.Log($"{System.DateTime.Now:HH:mm:ss:fff} OnClientChangeScene {sceneName} {sceneOperation}");
if (sceneOperation == SceneOperation.UnloadAdditive)
StartCoroutine(UnloadAdditive(sceneName));
if (sceneOperation == SceneOperation.LoadAdditive)
StartCoroutine(LoadAdditive(sceneName));
}
IEnumerator LoadAdditive(string sceneName)
{
isInTransition = true;
// This will return immediately if already faded in
// e.g. by UnloadAdditive or by default startup state
yield return fadeInOut.FadeIn();
// host client is on server...don't load the additive scene again
if (mode == NetworkManagerMode.ClientOnly)
{
// Start loading the additive subscene
loadingSceneAsync = SceneManager.LoadSceneAsync(sceneName, LoadSceneMode.Additive);
while (loadingSceneAsync != null && !loadingSceneAsync.isDone)
yield return null;
}
// Reset these to false when ready to proceed
NetworkClient.isLoadingScene = false;
isInTransition = false;
OnClientSceneChanged();
// Reveal the new scene content.
yield return fadeInOut.FadeOut();
}
IEnumerator UnloadAdditive(string sceneName)
{
isInTransition = true;
// This will return immediately if already faded in
// e.g. by LoadAdditive above or by default startup state.
yield return fadeInOut.FadeIn();
// host client is on server...don't unload the additive scene here.
if (mode == NetworkManagerMode.ClientOnly)
{
yield return SceneManager.UnloadSceneAsync(sceneName);
yield return Resources.UnloadUnusedAssets();
}
// Reset these to false when ready to proceed
NetworkClient.isLoadingScene = false;
isInTransition = false;
OnClientSceneChanged();
// There is no call to FadeOut here on purpose.
// Expectation is that a LoadAdditive or full scene change
// will follow that will call FadeOut after that scene loads.
}
/// <summary>
/// Called on clients when a scene has completed loaded, when the scene load was initiated by the server.
/// <para>Scene changes can cause player objects to be destroyed. The default implementation of OnClientSceneChanged in the NetworkManager is to add a player object for the connection if no player object exists.</para>
/// </summary>
/// <param name="conn">The network connection that the scene change message arrived on.</param>
public override void OnClientSceneChanged()
{
// Only call the base method if not in a transition.
// This will be called from LoadAdditive / UnloadAdditive after setting isInTransition to false
// but will also be called first by Mirror when the scene loading finishes.
if (!isInTransition)
base.OnClientSceneChanged();
}
#endregion
#region Server System Callbacks
/// <summary>
/// Called on the server when a client is ready.
/// <para>The default implementation of this function calls NetworkServer.SetClientReady() to continue the network setup process.</para>
/// </summary>
/// <param name="conn">Connection from client.</param>
public override void OnServerReady(NetworkConnectionToClient conn)
{
// This fires from a Ready message client sends to server after loading the online scene
base.OnServerReady(conn);
if (conn.identity == null)
StartCoroutine(AddPlayerDelayed(conn));
}
// This delay is mostly for the host player that loads too fast for the
// server to have subscenes async loaded from OnServerSceneChanged ahead of it.
IEnumerator AddPlayerDelayed(NetworkConnectionToClient conn)
{
// Wait for server to async load all subscenes for game instances
while (!subscenesLoaded)
yield return null;
// Send Scene msg to client telling it to load the first additive scene
conn.Send(new SceneMessage { sceneName = additiveScenes[0], sceneOperation = SceneOperation.LoadAdditive, customHandling = true });
// We have Network Start Positions in first additive scene...pick one
Transform start = GetStartPosition();
// Instantiate player as child of start position - this will place it in the additive scene
// This also lets player object "inherit" pos and rot from start position transform
GameObject player = Instantiate(playerPrefab, start);
// now set parent null to get it out from under the Start Position object
player.transform.SetParent(null);
// Wait for end of frame before adding the player to ensure Scene Message goes first
yield return new WaitForEndOfFrame();
// Finally spawn the player object for this connection
NetworkServer.AddPlayerForConnection(conn, player);
}
#endregion
}
}
fileFormatVersion: 2
guid: 01eafa8309a0894479f0f87ae1a9c30f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using UnityEngine;
using UnityEngine.UI;
namespace Mirror.Examples.AdditiveLevels
{
public class FadeInOut : MonoBehaviour
{
// set these in the inspector
[Tooltip("Reference to Image component on child panel")]
public Image fadeImage;
[Tooltip("Color to use during scene transition")]
public Color fadeColor = Color.black;
[Range(1, 100), Tooltip("Rate of fade in / out: higher is faster")]
public byte stepRate = 2;
float step;
void OnValidate()
{
if (fadeImage == null)
fadeImage = GetComponentInChildren<Image>();
}
void Start()
{
// Convert user-friendly setting value to working value
step = stepRate * 0.001f;
}
/// <summary>
/// Calculates FadeIn / FadeOut time.
/// </summary>
/// <returns>Duration in seconds</returns>
public float GetDuration()
{
float frames = 1 / step;
float frameRate = Time.deltaTime;
float duration = frames * frameRate * 0.1f;
return duration;
}
public IEnumerator FadeIn()
{
float alpha = fadeImage.color.a;
while (alpha < 1)
{
yield return null;
alpha += step;
fadeColor.a = alpha;
fadeImage.color = fadeColor;
}
}
public IEnumerator FadeOut()
{
float alpha = fadeImage.color.a;
while (alpha > 0)
{
yield return null;
alpha -= step;
fadeColor.a = alpha;
fadeImage.color = fadeColor;
}
}
}
}
fileFormatVersion: 2
guid: 363a8867bb9c7b845a73233566df8c1e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
namespace Mirror.Examples.AdditiveLevels
{
// This script is attached to portal labels to keep them facing the camera
public class LookAtMainCamera : MonoBehaviour
{
// This will be enabled by Portal script in OnStartClient
void OnValidate()
{
this.enabled = false;
}
// LateUpdate so that all camera updates are finished.
[ClientCallback]
void LateUpdate()
{
transform.forward = Camera.main.transform.forward;
}
}
}
fileFormatVersion: 2
guid: cc58300ee45438a418d9e32957fdc0c0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
namespace Mirror.Examples.AdditiveLevels
{
[RequireComponent(typeof(CapsuleCollider))]
[RequireComponent(typeof(CharacterController))]
[RequireComponent(typeof(NetworkTransformReliable))]
[RequireComponent(typeof(Rigidbody))]
public class PlayerController : NetworkBehaviour
{
public enum GroundState : byte { Jumping, Falling, Grounded }
[Header("Avatar Components")]
public CharacterController characterController;
[Header("Movement")]
[Range(1, 20)]
public float moveSpeedMultiplier = 8f;
[Header("Turning")]
[Range(1f, 200f)]
public float maxTurnSpeed = 100f;
[Range(.5f, 5f)]
public float turnDelta = 3f;
[Header("Jumping")]
[Range(0.1f, 1f)]
public float initialJumpSpeed = 0.2f;
[Range(1f, 10f)]
public float maxJumpSpeed = 5f;
[Range(0.1f, 1f)]
public float jumpDelta = 0.2f;
[Header("Diagnostics")]
[ReadOnly, SerializeField] GroundState groundState = GroundState.Grounded;
[ReadOnly, SerializeField, Range(-1f, 1f)]
float horizontal;
[ReadOnly, SerializeField, Range(-1f, 1f)]
float vertical;
[ReadOnly, SerializeField, Range(-200f, 200f)]
float turnSpeed;
[ReadOnly, SerializeField, Range(-10f, 10f)]
float jumpSpeed;
[ReadOnly, SerializeField, Range(-1.5f, 1.5f)]
float animVelocity;
[ReadOnly, SerializeField, Range(-1.5f, 1.5f)]
float animRotation;
[ReadOnly, SerializeField] Vector3Int velocity;
[ReadOnly, SerializeField] Vector3 direction;
protected override void OnValidate()
{
base.OnValidate();
if (characterController == null)
characterController = GetComponent<CharacterController>();
// Override CharacterController default values
characterController.enabled = false;
characterController.skinWidth = 0.02f;
characterController.minMoveDistance = 0f;
GetComponent<Rigidbody>().isKinematic = true;
this.enabled = false;
}
public override void OnStartAuthority()
{
characterController.enabled = true;
this.enabled = true;
}
public override void OnStopAuthority()
{
this.enabled = false;
characterController.enabled = false;
}
void Update()
{
if (!characterController.enabled)
return;
HandleTurning();
HandleJumping();
HandleMove();
// Reset ground state
if (characterController.isGrounded)
groundState = GroundState.Grounded;
else if (groundState != GroundState.Jumping)
groundState = GroundState.Falling;
// Diagnostic velocity...FloorToInt for display purposes
velocity = Vector3Int.FloorToInt(characterController.velocity);
}
// TODO: Turning works while airborne...feature?
void HandleTurning()
{
// Q and E cancel each other out, reducing the turn to zero.
if (Input.GetKey(KeyCode.Q))
turnSpeed = Mathf.MoveTowards(turnSpeed, -maxTurnSpeed, turnDelta);
if (Input.GetKey(KeyCode.E))
turnSpeed = Mathf.MoveTowards(turnSpeed, maxTurnSpeed, turnDelta);
// If both pressed, reduce turning speed toward zero.
if (Input.GetKey(KeyCode.Q) && Input.GetKey(KeyCode.E))
turnSpeed = Mathf.MoveTowards(turnSpeed, 0, turnDelta);
// If neither pressed, reduce turning speed toward zero.
if (!Input.GetKey(KeyCode.Q) && !Input.GetKey(KeyCode.E))
turnSpeed = Mathf.MoveTowards(turnSpeed, 0, turnDelta);
transform.Rotate(0f, turnSpeed * Time.deltaTime, 0f);
}
void HandleJumping()
{
// Handle variable force jumping.
// Jump starts with initial power on takeoff, and jumps higher / longer
// as player holds spacebar. Jump power is increased by a diminishing amout
// every frame until it reaches maxJumpSpeed, or player releases the spacebar,
// and then changes to the falling state until it gets grounded.
if (groundState != GroundState.Falling && Input.GetKey(KeyCode.Space))
{
if (groundState != GroundState.Jumping)
{
// Start jump at initial power.
groundState = GroundState.Jumping;
jumpSpeed = initialJumpSpeed;
}
else
// Jumping has already started...increase power toward maxJumpSpeed over time.
jumpSpeed = Mathf.MoveTowards(jumpSpeed, maxJumpSpeed, jumpDelta);
// If power has reached maxJumpSpeed, change to falling until grounded.
// This prevents over-applying jump power while already in the air.
if (jumpSpeed == maxJumpSpeed)
groundState = GroundState.Falling;
}
else if (groundState != GroundState.Grounded)
{
// handles running off a cliff and/or player released Spacebar.
groundState = GroundState.Falling;
jumpSpeed = Mathf.Min(jumpSpeed, maxJumpSpeed);
jumpSpeed += Physics.gravity.y * Time.deltaTime;
}
else
jumpSpeed = Physics.gravity.y * Time.deltaTime;
}
// TODO: Directional input works while airborne...feature?
void HandleMove()
{
// Capture inputs
horizontal = Input.GetAxis("Horizontal");
vertical = Input.GetAxis("Vertical");
// Create initial direction vector without jumpSpeed (y-axis).
direction = new Vector3(horizontal, 0f, vertical);
// Clamp so diagonal strafing isn't a speed advantage.
direction = Vector3.ClampMagnitude(direction, 1f);
// Transforms direction from local space to world space.
direction = transform.TransformDirection(direction);
// Multiply for desired ground speed.
direction *= moveSpeedMultiplier;
// Add jumpSpeed to direction as last step.
direction.y = jumpSpeed;
// Finally move the character.
characterController.Move(direction * Time.deltaTime);
}
}
}
fileFormatVersion: 2
guid: 05e10150710dde14b83d3c8f5aa853c2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.IO;
using System.Text.RegularExpressions;
using UnityEngine;
using UnityEngine.SceneManagement;
namespace Mirror.Examples.AdditiveLevels
{
public class Portal : NetworkBehaviour
{
[Scene, Tooltip("Which scene to send player from here")]
public string destinationScene;
[Tooltip("Where to spawn player in Destination Scene")]
public Vector3 startPosition;
[Tooltip("Reference to child TextMesh label")]
public TextMesh label; // don't depend on TMPro. 2019 errors.
[SyncVar(hook = nameof(OnLabelTextChanged))]
public string labelText;
public void OnLabelTextChanged(string _, string newValue)
{
label.text = labelText;
}
public override void OnStartServer()
{
labelText = Path.GetFileNameWithoutExtension(destinationScene).Replace("MirrorAdditiveLevels","");
// Simple Regex to insert spaces before capitals, numbers
labelText = Regex.Replace(labelText, @"\B[A-Z0-9]+", " $0");
}
public override void OnStartClient()
{
if (label.TryGetComponent(out LookAtMainCamera lookAtMainCamera))
lookAtMainCamera.enabled = true;
}
// Note that I have created layers called Player(6) and Portal(7) and set them
// up in the Physics collision matrix so only Player collides with Portal.
void OnTriggerEnter(Collider other)
{
// tag check in case you didn't set up the layers and matrix as noted above
if (!other.CompareTag("Player")) return;
// applies to host client on server and remote clients
if (other.TryGetComponent(out PlayerController playerController))
playerController.enabled = false;
if (isServer)
StartCoroutine(SendPlayerToNewScene(other.gameObject));
}
[ServerCallback]
IEnumerator SendPlayerToNewScene(GameObject player)
{
if (player.TryGetComponent(out NetworkIdentity identity))
{
NetworkConnectionToClient conn = identity.connectionToClient;
if (conn == null) yield break;
// Tell client to unload previous subscene with custom handling (see NetworkManager::OnClientChangeScene).
conn.Send(new SceneMessage { sceneName = gameObject.scene.path, sceneOperation = SceneOperation.UnloadAdditive, customHandling = true });
// wait for fader to complete
yield return new WaitForSeconds(AdditiveLevelsNetworkManager.singleton.fadeInOut.GetDuration());
// Remove player after fader has completed
NetworkServer.RemovePlayerForConnection(conn, RemovePlayerOptions.Unspawn);
// reposition player on server and client
player.transform.position = startPosition;
// Rotate player to face center of scene
// Player is 2m tall with pivot at 0,1,0 so we need to look at
// 1m height to not tilt the player down to look at origin
player.transform.LookAt(Vector3.up);
// Move player to new subscene.
SceneManager.MoveGameObjectToScene(player, SceneManager.GetSceneByPath(destinationScene));
// Tell client to load the new subscene with custom handling (see NetworkManager::OnClientChangeScene).
conn.Send(new SceneMessage { sceneName = destinationScene, sceneOperation = SceneOperation.LoadAdditive, customHandling = true });
// Player will be spawned after destination scene is loaded
NetworkServer.AddPlayerForConnection(conn, player);
// host client playerController would have been disabled by OnTriggerEnter above
// Remote client players are respawned with playerController already enabled
if (NetworkClient.localPlayer != null && NetworkClient.localPlayer.TryGetComponent(out PlayerController playerController))
playerController.enabled = true;
}
}
}
}
fileFormatVersion: 2
guid: 0e680878006965146a8f9d85834c4d1c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: a1ac2873c4eb8d64db33d7df8acb9188
folderAsset: yes
timeCreated: 1497127550
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 1566af6e663684dbd85aa5fb32fd9148
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 9ffeeee1accdc4b4faf2b3e27b226340
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment