JS Fauteux
4 年前
当前提交
367549e0
共有 65 个文件被更改,包括 3641 次插入 和 167 次删除
-
294Assets/BossRoom/Models/CharacterSetController.controller
-
55Assets/BossRoom/Scripts/Client/ClientCharacterVisualization.cs
-
56Assets/BossRoom/Scripts/Client/ClientInputSender.cs
-
1Assets/BossRoom/Scripts/Server/Game/Action/Action.cs
-
43Assets/BossRoom/Scripts/Server/Game/Character/ServerCharacter.cs
-
34Assets/BossRoom/Scripts/Shared/Game/Action/ActionRequestData.cs
-
12Assets/BossRoom/Scripts/Shared/NetworkCharacterState.cs
-
3Packages/manifest.json
-
122ProjectSettings/GraphicsSettings.asset
-
232Assets/BossRoom/Prefabs/EnemySpawner.prefab
-
7Assets/BossRoom/Prefabs/EnemySpawner.prefab.meta
-
54Assets/BossRoom/Scripts/Client/ClientSpawnerVisualization.cs
-
11Assets/BossRoom/Scripts/Client/ClientSpawnerVisualization.cs.meta
-
52Assets/BossRoom/Scripts/Server/Game/Action/ReviveAction.cs
-
3Assets/BossRoom/Scripts/Server/Game/Action/ReviveAction.cs.meta
-
258Assets/BossRoom/Scripts/Server/ServerWaveSpawner.cs
-
11Assets/BossRoom/Scripts/Server/ServerWaveSpawner.cs.meta
-
17Assets/BossRoom/Scripts/Shared/NetworkSpawnerState.cs
-
11Assets/BossRoom/Scripts/Shared/NetworkSpawnerState.cs.meta
-
39README.md
-
1.metadata/docs/terms-and-conditions.txt
-
35.metadata/images/icon.jpg
-
21.metadata/images/preview.png
-
16.metadata/metadata.yaml
-
124.yamato/upm-ci.yml
-
8Packages/com.unity.multiplayer.samples.coop/.npmignore
-
11Packages/com.unity.multiplayer.samples.coop/CHANGELOG.md
-
7Packages/com.unity.multiplayer.samples.coop/CHANGELOG.md.meta
-
315Packages/com.unity.multiplayer.samples.coop/Documentation~/images/example.png
-
67Packages/com.unity.multiplayer.samples.coop/Documentation~/images/gitlab_ci_secret_variables.png
-
555Packages/com.unity.multiplayer.samples.coop/Documentation~/images/gitlab_pipeline_download.png
-
483Packages/com.unity.multiplayer.samples.coop/Documentation~/images/gitlab_pipelines.png
-
448Packages/com.unity.multiplayer.samples.coop/Documentation~/images/template_in_new_project.png
-
137Packages/com.unity.multiplayer.samples.coop/Documentation~/index.md
-
5Packages/com.unity.multiplayer.samples.coop/LICENSE.md
-
7Packages/com.unity.multiplayer.samples.coop/LICENSE.md.meta
-
26Packages/com.unity.multiplayer.samples.coop/QAReport.md
-
7Packages/com.unity.multiplayer.samples.coop/QAReport.md.meta
-
39Packages/com.unity.multiplayer.samples.coop/README.md
-
7Packages/com.unity.multiplayer.samples.coop/README.md.meta
-
8Packages/com.unity.multiplayer.samples.coop/Tests.meta
-
8Packages/com.unity.multiplayer.samples.coop/Tests/Editor.meta
-
22Packages/com.unity.multiplayer.samples.coop/Tests/Editor/EditorExampleTest.cs
-
11Packages/com.unity.multiplayer.samples.coop/Tests/Editor/EditorExampleTest.cs.meta
-
12Packages/com.unity.multiplayer.samples.coop/Tests/Editor/EditorTests.asmdef
-
7Packages/com.unity.multiplayer.samples.coop/Tests/Editor/EditorTests.asmdef.meta
-
8Packages/com.unity.multiplayer.samples.coop/Tests/Runtime.meta
-
24Packages/com.unity.multiplayer.samples.coop/Tests/Runtime/RuntimeExampleTest.cs
-
11Packages/com.unity.multiplayer.samples.coop/Tests/Runtime/RuntimeExampleTest.cs.meta
-
6Packages/com.unity.multiplayer.samples.coop/Tests/Runtime/RuntimeTests.asmdef
-
7Packages/com.unity.multiplayer.samples.coop/Tests/Runtime/RuntimeTests.asmdef.meta
-
16Packages/com.unity.multiplayer.samples.coop/Third Party Notices.md
-
7Packages/com.unity.multiplayer.samples.coop/Third Party Notices.md.meta
-
20Packages/com.unity.multiplayer.samples.coop/package.json
-
7Packages/com.unity.multiplayer.samples.coop/package.json.meta
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!30 &1 |
|||
GraphicsSettings: |
|||
m_ObjectHideFlags: 0 |
|||
serializedVersion: 13 |
|||
m_Deferred: |
|||
m_Mode: 1 |
|||
m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} |
|||
m_DeferredReflections: |
|||
m_Mode: 1 |
|||
m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} |
|||
m_ScreenSpaceShadows: |
|||
m_Mode: 1 |
|||
m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} |
|||
m_LegacyDeferred: |
|||
m_Mode: 1 |
|||
m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} |
|||
m_DepthNormals: |
|||
m_Mode: 1 |
|||
m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} |
|||
m_MotionVectors: |
|||
m_Mode: 1 |
|||
m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} |
|||
m_LightHalo: |
|||
m_Mode: 1 |
|||
m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} |
|||
m_LensFlare: |
|||
m_Mode: 1 |
|||
m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} |
|||
m_VideoShadersIncludeMode: 2 |
|||
m_AlwaysIncludedShaders: |
|||
- {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} |
|||
- {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} |
|||
- {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} |
|||
- {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} |
|||
- {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} |
|||
- {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} |
|||
m_PreloadedShaders: [] |
|||
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} |
|||
m_CustomRenderPipeline: {fileID: 0} |
|||
m_TransparencySortMode: 0 |
|||
m_TransparencySortAxis: {x: 0, y: 0, z: 1} |
|||
m_DefaultRenderingPath: 1 |
|||
m_DefaultMobileRenderingPath: 1 |
|||
m_TierSettings: |
|||
- serializedVersion: 5 |
|||
m_BuildTarget: 1 |
|||
m_Tier: 0 |
|||
m_Settings: |
|||
standardShaderQuality: 2 |
|||
renderingPath: 3 |
|||
hdrMode: 1 |
|||
realtimeGICPUUsage: 25 |
|||
useReflectionProbeBoxProjection: 1 |
|||
useReflectionProbeBlending: 1 |
|||
useHDR: 1 |
|||
useDetailNormalMap: 1 |
|||
useCascadedShadowMaps: 1 |
|||
prefer32BitShadowMaps: 0 |
|||
enableLPPV: 1 |
|||
useDitherMaskForAlphaBlendedShadows: 1 |
|||
m_Automatic: 0 |
|||
- serializedVersion: 5 |
|||
m_BuildTarget: 1 |
|||
m_Tier: 1 |
|||
m_Settings: |
|||
standardShaderQuality: 2 |
|||
renderingPath: 3 |
|||
hdrMode: 1 |
|||
realtimeGICPUUsage: 25 |
|||
useReflectionProbeBoxProjection: 1 |
|||
useReflectionProbeBlending: 1 |
|||
useHDR: 1 |
|||
useDetailNormalMap: 1 |
|||
useCascadedShadowMaps: 1 |
|||
prefer32BitShadowMaps: 0 |
|||
enableLPPV: 1 |
|||
useDitherMaskForAlphaBlendedShadows: 1 |
|||
m_Automatic: 0 |
|||
- serializedVersion: 5 |
|||
m_BuildTarget: 1 |
|||
m_Tier: 2 |
|||
m_Settings: |
|||
standardShaderQuality: 2 |
|||
renderingPath: 3 |
|||
hdrMode: 1 |
|||
realtimeGICPUUsage: 50 |
|||
useReflectionProbeBoxProjection: 1 |
|||
useReflectionProbeBlending: 1 |
|||
useHDR: 1 |
|||
useDetailNormalMap: 1 |
|||
useCascadedShadowMaps: 1 |
|||
prefer32BitShadowMaps: 0 |
|||
enableLPPV: 1 |
|||
useDitherMaskForAlphaBlendedShadows: 1 |
|||
m_Automatic: 0 |
|||
m_LightmapStripping: 0 |
|||
m_FogStripping: 0 |
|||
m_InstancingStripping: 0 |
|||
m_LightmapKeepPlain: 1 |
|||
m_LightmapKeepDirCombined: 1 |
|||
m_LightmapKeepDynamicPlain: 1 |
|||
m_LightmapKeepDynamicDirCombined: 1 |
|||
m_LightmapKeepShadowMask: 1 |
|||
m_LightmapKeepSubtractive: 1 |
|||
m_FogKeepLinear: 1 |
|||
m_FogKeepExp: 1 |
|||
m_FogKeepExp2: 1 |
|||
m_AlbedoSwatchInfos: [] |
|||
m_LightsUseLinearIntensity: 0 |
|||
m_LightsUseColorTemperature: 0 |
|||
m_DefaultRenderingLayerMask: 1 |
|||
m_LogWhenShaderIsCompiled: 0 |
|||
version https://git-lfs.github.com/spec/v1 |
|||
<<<<<<< HEAD |
|||
oid sha256:a06b62f70a65345f430b10b6241693d1e969fbecffb1c158ac330169470fab52 |
|||
size 3569 |
|||
======= |
|||
oid sha256:442894020eebc9cfeddc7b95f3e637fdcf033513a507e0fbe231a8e0e4f7d60b |
|||
size 2230 |
|||
>>>>>>> 4459f56 (LFS is terrorising me) |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!1 &4132435922419856147 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 9136068542165043480} |
|||
- component: {fileID: 8205974096611502342} |
|||
m_Layer: 0 |
|||
m_Name: Client_Visuals |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!4 &9136068542165043480 |
|||
Transform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 4132435922419856147} |
|||
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: 3784477753691126980} |
|||
m_Father: {fileID: 8727022540156222958} |
|||
m_RootOrder: 0 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
|||
--- !u!114 &8205974096611502342 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 4132435922419856147} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: 65e25a152b731564ebb6096eb5e9f0ed, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
|||
m_NetworkSpawnerState: {fileID: 9132488263322830174} |
|||
m_Animator: {fileID: 0} |
|||
--- !u!1 &6205854018081152875 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 8727022540156222958} |
|||
- component: {fileID: 7323075965458333149} |
|||
- component: {fileID: -1287160331463954971} |
|||
- component: {fileID: 4844841199312666291} |
|||
- component: {fileID: 9132488263322830174} |
|||
m_Layer: 6 |
|||
m_Name: EnemySpawner |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!4 &8727022540156222958 |
|||
Transform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 6205854018081152875} |
|||
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: 9136068542165043480} |
|||
m_Father: {fileID: 0} |
|||
m_RootOrder: 0 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
|||
--- !u!136 &7323075965458333149 |
|||
CapsuleCollider: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 6205854018081152875} |
|||
m_Material: {fileID: 0} |
|||
m_IsTrigger: 0 |
|||
m_Enabled: 1 |
|||
m_Radius: 0.5 |
|||
m_Height: 2 |
|||
m_Direction: 1 |
|||
m_Center: {x: 0, y: 0, z: 0} |
|||
--- !u!114 &-1287160331463954971 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 6205854018081152875} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
|||
NetworkedInstanceId: 0 |
|||
PrefabHash: 15589198230175896383 |
|||
PrefabHashGenerator: Spawner |
|||
AlwaysReplicateAsRoot: 0 |
|||
DontDestroyWithOwner: 0 |
|||
--- !u!114 &4844841199312666291 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 6205854018081152875} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: 49b962917cae99f48a2a598485996b8d, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
|||
m_NetworkSpawnerState: {fileID: 9132488263322830174} |
|||
m_NetworkedPrefab: {fileID: -7852138837387268381, guid: f520174fcd7d61441aa46a9923655dcd, type: 3} |
|||
m_BlockingMask: |
|||
serializedVersion: 2 |
|||
m_Bits: 1 |
|||
m_PlayerProximityValidationTimestep: 2 |
|||
m_NumberOfWaves: 2 |
|||
m_SpawnsPerWave: 2 |
|||
m_TimeBetweenSpawns: 0.5 |
|||
m_TimeBetweenWaves: 5 |
|||
m_RestartDelay: 10 |
|||
m_ProximityDistance: 30 |
|||
m_DormantCooldown: 10 |
|||
--- !u!114 &9132488263322830174 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 6205854018081152875} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: 4cfeccaf46c46e1458c3f7351d6753b3, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
|||
--- !u!1 &6882351788430859438 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 3784477753691126980} |
|||
- component: {fileID: 1033544756360169842} |
|||
- component: {fileID: 4871652750507758710} |
|||
m_Layer: 0 |
|||
m_Name: Capsule |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!4 &3784477753691126980 |
|||
Transform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 6882351788430859438} |
|||
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_Father: {fileID: 9136068542165043480} |
|||
m_RootOrder: 0 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
|||
--- !u!33 &1033544756360169842 |
|||
MeshFilter: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 6882351788430859438} |
|||
m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} |
|||
--- !u!23 &4871652750507758710 |
|||
MeshRenderer: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 6882351788430859438} |
|||
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_RayTraceProcedural: 0 |
|||
m_RenderingLayerMask: 1 |
|||
m_RendererPriority: 0 |
|||
m_Materials: |
|||
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} |
|||
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 |
|||
m_AdditionalVertexStreams: {fileID: 0} |
|
|||
fileFormatVersion: 2 |
|||
guid: a6647793a8bc7c846abba94be1d257e5 |
|||
PrefabImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using MLAPI; |
|||
using UnityEngine; |
|||
|
|||
namespace BossRoom |
|||
{ |
|||
public class ClientSpawnerVisualization : NetworkedBehaviour |
|||
{ |
|||
[SerializeField] |
|||
NetworkSpawnerState m_NetworkSpawnerState; |
|||
|
|||
// TODO: Integrate visuals (GOMPS-123)
|
|||
[SerializeField] |
|||
Animator m_Animator; |
|||
|
|||
public override void NetworkStart() |
|||
{ |
|||
if (!IsClient) |
|||
{ |
|||
enabled = false; |
|||
return; |
|||
} |
|||
|
|||
m_NetworkSpawnerState.Broken.OnValueChanged += BrokenStateChanged; |
|||
m_NetworkSpawnerState.HitPoints.OnValueChanged += HitPointsChanged; |
|||
} |
|||
|
|||
void BrokenStateChanged(bool previousValue, bool newValue) |
|||
{ |
|||
if (newValue) |
|||
{ |
|||
if (previousValue == false) |
|||
{ |
|||
// spawner is newly broken
|
|||
} |
|||
} |
|||
else |
|||
{ |
|||
if (previousValue) |
|||
{ |
|||
// spawner is newly revived
|
|||
} |
|||
} |
|||
} |
|||
|
|||
void HitPointsChanged(int previousValue, int newValue) |
|||
{ |
|||
if (previousValue > newValue && newValue > 0) |
|||
{ |
|||
// received a hit
|
|||
} |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 65e25a152b731564ebb6096eb5e9f0ed |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using MLAPI.Spawning; |
|||
using UnityEngine; |
|||
|
|||
namespace BossRoom.Server |
|||
{ |
|||
public class ReviveAction : Action |
|||
{ |
|||
private bool m_ExecFired; |
|||
private ServerCharacter m_TargetCharacter; |
|||
|
|||
public ReviveAction(ServerCharacter parent, ref ActionRequestData data, int level) : base(parent, ref data, level) |
|||
{ |
|||
} |
|||
|
|||
public override bool Start() |
|||
{ |
|||
if (m_Data.TargetIds == null || m_Data.TargetIds.Length == 0 || !SpawnManager.SpawnedObjects.ContainsKey(m_Data.TargetIds[0])) |
|||
{ |
|||
Debug.Log("Failed to start ReviveAction. The target entity wasn't submitted or doesn't exist anymore"); |
|||
return false; |
|||
} |
|||
|
|||
var targetNeworkedObj = SpawnManager.SpawnedObjects[m_Data.TargetIds[0]]; |
|||
m_TargetCharacter = targetNeworkedObj.GetComponent<ServerCharacter>(); |
|||
m_Parent.NetState.ServerBroadcastAction(ref Data); |
|||
|
|||
return true; |
|||
} |
|||
|
|||
public override bool Update() |
|||
{ |
|||
if (!m_ExecFired && Time.time - TimeStarted >= Description.ExecTime_s) |
|||
{ |
|||
m_ExecFired = true; |
|||
|
|||
if (m_TargetCharacter.NetState.NetworkLifeState.Value == LifeState.FAINTED) |
|||
{ |
|||
m_TargetCharacter.Revive(m_Parent, (int) m_Data.Amount); |
|||
} |
|||
else |
|||
{ |
|||
//cancel the action if the target is alive!
|
|||
Cancel(); |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
|
|||
return true; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 1122d1ad1a0b437c8a0e586ecb64449d |
|||
timeCreated: 1610045410 |
|
|||
using System.Collections; |
|||
using UnityEngine; |
|||
using MLAPI; |
|||
|
|||
namespace BossRoom.Server |
|||
{ |
|||
/// <summary>
|
|||
/// Component responsible for spawning prefab clones in waves on the server.
|
|||
/// </summary>
|
|||
[RequireComponent(typeof(Collider))] |
|||
public class ServerWaveSpawner : NetworkedBehaviour |
|||
{ |
|||
[SerializeField] |
|||
NetworkSpawnerState m_NetworkSpawnerState; |
|||
|
|||
// amount of hits it takes to break any spawner
|
|||
const int k_MaxHealth = 3; |
|||
|
|||
// networked object that will be spawned in waves
|
|||
[SerializeField] |
|||
NetworkedObject m_NetworkedPrefab; |
|||
|
|||
// cache reference to our own transform
|
|||
Transform m_Transform; |
|||
|
|||
// track wave index and reset once all waves are complete
|
|||
int m_WaveIndex; |
|||
|
|||
// keep reference to our wave spawning coroutine
|
|||
Coroutine m_WaveSpawning; |
|||
|
|||
// cache array of RaycastHit as it will be reused for player visibility
|
|||
RaycastHit[] m_Hit; |
|||
|
|||
int m_PlayerLayerMask; |
|||
|
|||
// cache Collider array of OverlapSphere results for player proximity
|
|||
Collider[] m_Colliders; |
|||
|
|||
[Tooltip("Select which layers will block visibility.")] |
|||
[SerializeField] |
|||
LayerMask m_BlockingMask; |
|||
|
|||
[Tooltip("Time between player distance & visibility scans, in seconds.")] |
|||
[SerializeField] |
|||
float m_PlayerProximityValidationTimestep; |
|||
|
|||
[Header("Wave parameters")] |
|||
[Tooltip("Total number of waves.")] |
|||
[SerializeField] |
|||
int m_NumberOfWaves; |
|||
[Tooltip("Number of spawns per wave.")] |
|||
[SerializeField] |
|||
int m_SpawnsPerWave; |
|||
[Tooltip("Time between individual spawns, in seconds.")] |
|||
[SerializeField] |
|||
float m_TimeBetweenSpawns; |
|||
[Tooltip("Time between waves, in seconds.")] |
|||
[SerializeField] |
|||
float m_TimeBetweenWaves; |
|||
[Tooltip("Once last wave is spawned, the spawner waits this long to restart wave spawns, in seconds.")] |
|||
[SerializeField] |
|||
float m_RestartDelay; |
|||
[Tooltip("A player must be withing this distance to commence first wave spawn.")] |
|||
[SerializeField] |
|||
float m_ProximityDistance; |
|||
[Tooltip("After being broken, the spawner waits this long to restart wave spawns, in seconds.")] |
|||
[SerializeField] |
|||
float m_DormantCooldown; |
|||
|
|||
void Awake() |
|||
{ |
|||
m_Transform = transform; |
|||
m_PlayerLayerMask = LayerMask.GetMask("PCs"); |
|||
} |
|||
|
|||
public override void NetworkStart() |
|||
{ |
|||
base.NetworkStart(); |
|||
|
|||
if (!IsServer) |
|||
{ |
|||
enabled = false; |
|||
return; |
|||
} |
|||
|
|||
ReviveSpawner(); |
|||
m_Hit = new RaycastHit[1]; |
|||
m_Colliders = new Collider[8]; |
|||
StartCoroutine(ValidatePlayersProximity(StartWaveSpawning)); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Coroutine for continually validating proximity to players and invoking an action when any is near.
|
|||
/// </summary>
|
|||
/// <param name="validationAction"></param>
|
|||
/// <returns></returns>
|
|||
IEnumerator ValidatePlayersProximity(System.Action validationAction) |
|||
{ |
|||
while (true) |
|||
{ |
|||
if (m_NetworkSpawnerState.Broken.Value) |
|||
{ |
|||
yield return new WaitForSeconds(m_DormantCooldown); |
|||
ReviveSpawner(); |
|||
} |
|||
|
|||
if (m_WaveSpawning == null) |
|||
{ |
|||
if (IsAnyPlayerNearbyAndVisible()) |
|||
{ |
|||
validationAction(); |
|||
} |
|||
} |
|||
else |
|||
{ |
|||
// do nothing, a wave spawning routine is currently underway
|
|||
} |
|||
|
|||
yield return new WaitForSeconds(m_PlayerProximityValidationTimestep); |
|||
} |
|||
} |
|||
|
|||
void StartWaveSpawning() |
|||
{ |
|||
StopWaveSpawning(); |
|||
|
|||
m_WaveSpawning = StartCoroutine(SpawnWaves()); |
|||
} |
|||
|
|||
void StopWaveSpawning() |
|||
{ |
|||
if (m_WaveSpawning != null) |
|||
{ |
|||
StopCoroutine(m_WaveSpawning); |
|||
} |
|||
m_WaveSpawning = null; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Coroutine for spawning prefabs clones in waves, waiting a duration before spawning a new wave.
|
|||
/// Once all waves are completed, it waits a restart time before termination.
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
IEnumerator SpawnWaves() |
|||
{ |
|||
m_WaveIndex = 0; |
|||
|
|||
while (m_WaveIndex < m_NumberOfWaves) |
|||
{ |
|||
yield return SpawnWave(); |
|||
|
|||
yield return new WaitForSeconds(m_TimeBetweenWaves); |
|||
} |
|||
|
|||
yield return new WaitForSeconds(m_RestartDelay); |
|||
|
|||
m_WaveSpawning = null; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Coroutine that spawns a wave of prefab clones, with some time between spawns.
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
IEnumerator SpawnWave() |
|||
{ |
|||
for (int i = 0; i < m_SpawnsPerWave; i++) |
|||
{ |
|||
SpawnPrefab(); |
|||
|
|||
yield return new WaitForSeconds(m_TimeBetweenSpawns); |
|||
} |
|||
|
|||
m_WaveIndex++; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Spawn a NetworkedObject prefab clone.
|
|||
/// </summary>
|
|||
void SpawnPrefab() |
|||
{ |
|||
if (m_NetworkedPrefab == null) |
|||
{ |
|||
throw new System.ArgumentNullException("m_NetworkedPrefab"); |
|||
} |
|||
|
|||
// spawn clone right in front of spawner
|
|||
var spawnPosition = m_Transform.position + m_Transform.forward; |
|||
var clone = Instantiate(m_NetworkedPrefab, spawnPosition, Quaternion.identity); |
|||
if (!clone.IsSpawned) |
|||
{ |
|||
clone.Spawn(); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Determines whether any player is within range & visible through RaycastNonAlloc check.
|
|||
/// </summary>
|
|||
/// <returns> True if visible and within range, else false. </returns>
|
|||
bool IsAnyPlayerNearbyAndVisible() |
|||
{ |
|||
var spawnerPosition = m_Transform.position; |
|||
|
|||
var ray = new Ray(); |
|||
|
|||
int hits = Physics.OverlapSphereNonAlloc(spawnerPosition, |
|||
m_ProximityDistance, m_Colliders, m_PlayerLayerMask); |
|||
|
|||
if (hits == 0) |
|||
{ |
|||
return false; |
|||
} |
|||
|
|||
// iterate through players and only return true if a player is in range
|
|||
// and is not occluded by a blocking collider.
|
|||
foreach (var playerCollider in m_Colliders) |
|||
{ |
|||
var playerPosition = playerCollider.transform.position; |
|||
var direction = playerPosition - spawnerPosition; |
|||
|
|||
ray.origin = spawnerPosition; |
|||
ray.direction = direction; |
|||
|
|||
var hit = Physics.RaycastNonAlloc(ray, m_Hit, |
|||
Mathf.Min(direction.magnitude, m_ProximityDistance),m_BlockingMask); |
|||
if (hit == 0) |
|||
{ |
|||
return true; |
|||
} |
|||
} |
|||
|
|||
return false; |
|||
} |
|||
|
|||
void ReviveSpawner() |
|||
{ |
|||
m_NetworkSpawnerState.HitPoints.Value = k_MaxHealth; |
|||
m_NetworkSpawnerState.Broken.Value = false; |
|||
} |
|||
|
|||
// TODO: David will create interface hookup for receiving hits on non-NPC/PC objects (GOMPS-ID TBD)
|
|||
void ReceiveHP(ServerCharacter inflicter, int HP) |
|||
{ |
|||
if (!IsServer) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
m_NetworkSpawnerState.HitPoints.Value += HP; |
|||
|
|||
if (m_NetworkSpawnerState.HitPoints.Value <= 0) |
|||
{ |
|||
m_NetworkSpawnerState.Broken.Value = true; |
|||
StopWaveSpawning(); |
|||
} |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 49b962917cae99f48a2a598485996b8d |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using MLAPI; |
|||
using MLAPI.NetworkedVar; |
|||
using UnityEngine; |
|||
|
|||
namespace BossRoom |
|||
{ |
|||
/// <summary>
|
|||
/// Contains all NetworkedVars of a spawner.
|
|||
/// This component is present on both client and server objects.
|
|||
/// </summary>
|
|||
public class NetworkSpawnerState : NetworkedBehaviour |
|||
{ |
|||
public NetworkedVarInt HitPoints { get; } = new NetworkedVarInt(); |
|||
|
|||
public NetworkedVarBool Broken { get; } = new NetworkedVarBool(); |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 4cfeccaf46c46e1458c3f7351d6753b3 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
# TODOs (trimmed down version of tasks listed at: https://github.cds.internal.unity3d.com/unity/com.unity.template-starter-kit) |
|||
|
|||
##### Fill in your project template's package information |
|||
|
|||
Update the following required fields in `Packages/com.unity.template.mytemplate/package.json`: |
|||
- `name`: Project template's package name, it should follow this naming convention: `com.unity.template.[your-template-name]` |
|||
(Example: `com.unity.template.3d`) |
|||
- `displayName`: Package user friendly display name. (Example: `"First person shooter"`). <br>__Note:__ Use a display name that will help users understand what your project template is intended for. |
|||
- `version`: Package version `X.Y.Z`, your project **must** adhere to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). |
|||
- `unity`: Minimum Unity Version your project template is compatible with. (Example: `2018.3`) |
|||
- `description`: This is the description for your template which will be displayed to the user to let them know what this template is for. This description shouldn't include anything version-specific and should stay pretty consistent across template versions. |
|||
- `dependencies`: Specify the dependencies the template requires. If you add a package to your project, you should also add it here. We try to keep this list as lean as possible to avoid conflicts as much as possible. |
|||
|
|||
##### Update **README.md** |
|||
|
|||
The README.md file should contain all pertinent information for template developers, such as: |
|||
* Prerequisites |
|||
* External tools or development libraries |
|||
* Required installed Software |
|||
|
|||
The Readme file at the root of the project should be the same as the one found in the template package folder. |
|||
|
|||
##### Prepare your documentation |
|||
|
|||
Rename and update **Packages/com.unity.template.mytemplate/Documentation~/your-package-name.md** documentation file. |
|||
|
|||
Use this documentation template to create preliminary, high-level documentation for the _development_ of your template's package. This document is meant to introduce other developers to the features and sample files included in your project template. |
|||
|
|||
Your template's documentation will be made available online and in the editor during publishing to guide our users. |
|||
|
|||
##### Update the changelog |
|||
|
|||
**Packages/com.unity.template.mytemplate/CHANGELOG.md**. |
|||
|
|||
Every new feature or bug fix should have a trace in this file. For more details on the chosen changelog format, see [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). |
|||
|
|||
Changelogs will be made available online to inform users about the changes they can expect when downloading a project template. As a consequence, the changelog content should be customer friendly and present clear, meaningful information. |
|||
|
|||
#### Complete the rest of the steps in the link regarding Legal & Testing |
|
|||
THIS IS THE TERMS AND CONDITIONS PLACEHOLDER |
|
|||
packageName: com.unity.template.xxx |
|||
name: NEW NAME |
|||
description: translationMap |
|||
icon: file://images/icon.png |
|||
previewImage: file://images/preview.png |
|||
category: Core |
|||
buildPlatform: Windows |
|||
renderPipeline: BuiltIn |
|||
termsOfService: file://docs/terms-and-conditions.txt |
|||
#extraFields: # (Optional) - A list of extra metadata that can be developer-defined as key/value pairs where value is always a string. |
|||
# - name: ageGate |
|||
# value: "12+" |
|||
translationMap: |
|||
description: |
|||
en-US: "With this template, blablabla" |
|||
zh-CN: "使用此模板,..." |
|
|||
target_editor: |
|||
version: 2019.4 |
|||
test_editors: |
|||
- version: 2019.4 |
|||
#- version: 2020.1 |
|||
#- version: 2020.2 |
|||
#- version: trunk |
|||
test_platforms: |
|||
- name: win |
|||
type: Unity::VM |
|||
image: package-ci/win10:stable |
|||
flavor: b1.large |
|||
- name: mac |
|||
type: Unity::VM::osx |
|||
image: package-ci/mac:stable |
|||
flavor: m1.mac |
|||
#- name: ubuntu |
|||
# type: Unity::VM |
|||
# image: package-ci/ubuntu:stable |
|||
# flavor: b1.large |
|||
# Use if Linux instance with GPU required |
|||
#- name: centos |
|||
# type: Unity::VM::GPU |
|||
# image: package-ci/centos:stable |
|||
# flavor: b1.large |
|||
--- |
|||
prepack: |
|||
name: Pre-Pack - Primed Artifacts |
|||
agent: |
|||
type: Unity::VM |
|||
image: package-ci/win10:stable |
|||
flavor: b1.large |
|||
commands: |
|||
- pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade |
|||
- unity-downloader-cli -u {{target_editor.version}} -c editor -w |
|||
- .\.Editor\Unity.exe -batchmode -quit |
|||
artifacts: |
|||
primed: |
|||
paths: |
|||
- "Library/Artifacts/**" |
|||
- "Library/ArtifactDB" |
|||
- "Library/SourceAssetDB" |
|||
|
|||
pack: |
|||
name: Pack |
|||
agent: |
|||
type: Unity::VM |
|||
image: package-ci/ubuntu:stable |
|||
flavor: b1.large |
|||
commands: |
|||
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm |
|||
- upm-ci template pack |
|||
dependencies: |
|||
- .yamato/upm-ci.yml#prepack |
|||
artifacts: |
|||
packages: |
|||
paths: |
|||
- "upm-ci~/**/*" |
|||
|
|||
{% for editor in test_editors %} |
|||
{% for platform in test_platforms %} |
|||
test_{{ platform.name }}_{{ editor.version }}: |
|||
name : Test {{ editor.version }} on {{ platform.name }} |
|||
agent: |
|||
type: {{ platform.type }} |
|||
image: {{ platform.image }} |
|||
flavor: {{ platform.flavor}} |
|||
commands: |
|||
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm |
|||
- {% if platform.name == "centos" %}DISPLAY=:0 {% endif %}upm-ci template test -u {{ editor.version }} |
|||
artifacts: |
|||
logs: |
|||
paths: |
|||
- "upm-ci~/test-results/**/*" |
|||
dependencies: |
|||
- .yamato/upm-ci.yml#pack |
|||
{% endfor %} |
|||
{% endfor %} |
|||
|
|||
test_trigger: |
|||
name: Tests Trigger |
|||
triggers: |
|||
branches: |
|||
only: |
|||
- "master" |
|||
- "dev" |
|||
- "/staging-.*/" |
|||
pull_requests: |
|||
- targets: |
|||
only: |
|||
- "/.*/" |
|||
dependencies: |
|||
- .yamato/upm-ci.yml#pack |
|||
{% for editor in test_editors %} |
|||
{% for platform in test_platforms %} |
|||
- .yamato/upm-ci.yml#test_{{platform.name}}_{{editor.version}} |
|||
{% endfor %} |
|||
{% endfor %} |
|||
|
|||
publish: |
|||
name: Publish to Internal Registry |
|||
agent: |
|||
type: Unity::VM |
|||
image: package-ci/win10:stable |
|||
flavor: b1.large |
|||
commands: |
|||
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm |
|||
- upm-ci template publish |
|||
triggers: |
|||
tags: |
|||
only: |
|||