Add StickGame Assets

This commit is contained in:
Dzejkobik007
2024-03-24 22:21:16 +01:00
parent 5a5812c0c7
commit 6c8b523d1f
6643 changed files with 596260 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: eac3bb4d33654b949b68cda7cd1209b2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,77 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Player
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.44982982, g: 0.8207547, b: 0.2748754, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 143d8fe5f64b27d44a592f57d7949e1c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,10 @@
THIS DEMO REQUIRES FISH-NETWORKING PRO
- Enable LOD inside the Fish-Networking > Developer menu.
- Open scene.
- Select LOD Tester in scene and slide LOD Level.
- Press Play.
Can be tested as clientHost, or server and client separate.
LOD Level cannot be changed at runtime.
A level of 1 is the same as not using LOD.

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c373771d26a3af04a84bd1afd5aabfe8
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3060a1729644a5a489574203c0653563
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,211 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &4512293259955182959
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4512293259955182957}
- component: {fileID: 4512293259955182956}
- component: {fileID: 6667641716399555817}
- component: {fileID: -5271135124957689192}
m_Layer: 0
m_Name: LODObjectPrefab
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4512293259955182957
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4512293259955182959}
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: 2745247498903379289}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &4512293259955182956
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4512293259955182959}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3}
m_Name:
m_EditorClassIdentifier:
NetworkObserver: {fileID: 0}
<PrefabId>k__BackingField: 26
<SpawnableCollectionId>k__BackingField: 0
_scenePathHash: 0
<SceneId>k__BackingField: 0
<AssetPathHash>k__BackingField: 1985539020153172578
<IsNested>k__BackingField: 0
<ComponentIndex>k__BackingField: 0
<PredictedSpawn>k__BackingField: {fileID: 0}
_networkBehaviours:
- {fileID: 6667641716399555817}
- {fileID: -5271135124957689192}
<ParentNetworkObject>k__BackingField: {fileID: 0}
<ChildNetworkObjects>k__BackingField: []
SerializedTransformProperties:
Position: {x: 0, y: 0, z: 0}
Rotation: {x: 0, y: 0, z: 0, w: 1}
LocalScale: {x: 1, y: 1, z: 1}
_isNetworked: 1
_isGlobal: 0
_initializeOrder: 0
_defaultDespawnType: 0
--- !u!114 &6667641716399555817
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4512293259955182959}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9880e85651efd71469092ce519317f7b, type: 3}
m_Name:
m_EditorClassIdentifier:
_componentIndexCache: 0
_addedNetworkObject: {fileID: 4512293259955182956}
_networkObjectCache: {fileID: 4512293259955182956}
_renderer: {fileID: 0}
_updateRotation: 1
--- !u!114 &-5271135124957689192
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4512293259955182959}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a2836e36774ca1c4bbbee976e17b649c, type: 3}
m_Name:
m_EditorClassIdentifier:
_componentIndexCache: 1
_addedNetworkObject: {fileID: 4512293259955182956}
_networkObjectCache: {fileID: 4512293259955182956}
_componentConfiguration: 0
_synchronizeParent: 0
_packing:
Position: 1
Rotation: 1
Scale: 0
_interpolation: 2
_extrapolation: 2
_enableTeleport: 0
_teleportThreshold: 1
_scaleThreshold: 1
_clientAuthoritative: 1
_sendToOwner: 1
_enableNetworkLod: 1
_interval: 1
_synchronizePosition: 1
_positionSnapping:
X: 0
Y: 0
Z: 0
_synchronizeRotation: 1
_rotationSnapping:
X: 0
Y: 0
Z: 0
_synchronizeScale: 1
_scaleSnapping:
X: 0
Y: 0
Z: 0
--- !u!1 &5839577311109879042
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2745247498903379289}
- component: {fileID: 3127415364279584095}
- component: {fileID: 5921142425762840611}
m_Layer: 0
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2745247498903379289
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5839577311109879042}
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: 4512293259955182957}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &3127415364279584095
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5839577311109879042}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &5921142425762840611
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5839577311109879042}
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: 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

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f32d4c19de900e64cb73cedcb8ba6f70
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,17 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4489d77032a81ef42b0067acf2737d4d, type: 3}
m_Name: Network LOD_Prefabs
m_EditorClassIdentifier:
_prefabs:
- {fileID: 4512293259955182956, guid: 300370bdf7819da41937e0beac65b32c, type: 3}
- {fileID: 4512293259955182956, guid: f32d4c19de900e64cb73cedcb8ba6f70, type: 3}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0078a285cda09f349b2668a721a53212
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,211 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &4512293259955182959
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4512293259955182957}
- component: {fileID: 4512293259955182956}
- component: {fileID: 6667641716399555817}
- component: {fileID: -5271135124957689192}
m_Layer: 0
m_Name: PlayerPrefab
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4512293259955182957
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4512293259955182959}
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: 2745247498903379289}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &4512293259955182956
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4512293259955182959}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3}
m_Name:
m_EditorClassIdentifier:
NetworkObserver: {fileID: 0}
<PrefabId>k__BackingField: 6
<SpawnableCollectionId>k__BackingField: 0
_scenePathHash: 2359702710
<SceneId>k__BackingField: 0
<AssetPathHash>k__BackingField: 7585316040777855176
<IsNested>k__BackingField: 0
<ComponentIndex>k__BackingField: 0
<PredictedSpawn>k__BackingField: {fileID: 0}
_networkBehaviours:
- {fileID: 6667641716399555817}
- {fileID: -5271135124957689192}
<ParentNetworkObject>k__BackingField: {fileID: 0}
<ChildNetworkObjects>k__BackingField: []
SerializedTransformProperties:
Position: {x: 0, y: 0, z: 0}
Rotation: {x: 0, y: 0, z: 0, w: 1}
LocalScale: {x: 1, y: 1, z: 1}
_isNetworked: 1
_isGlobal: 0
_initializeOrder: 0
_defaultDespawnType: 0
--- !u!114 &6667641716399555817
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4512293259955182959}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9880e85651efd71469092ce519317f7b, type: 3}
m_Name:
m_EditorClassIdentifier:
_componentIndexCache: 0
_addedNetworkObject: {fileID: 4512293259955182956}
_networkObjectCache: {fileID: 4512293259955182956}
_renderer: {fileID: 0}
_updateRotation: 1
--- !u!114 &-5271135124957689192
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4512293259955182959}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a2836e36774ca1c4bbbee976e17b649c, type: 3}
m_Name:
m_EditorClassIdentifier:
_componentIndexCache: 1
_addedNetworkObject: {fileID: 4512293259955182956}
_networkObjectCache: {fileID: 4512293259955182956}
_componentConfiguration: 0
_synchronizeParent: 0
_packing:
Position: 1
Rotation: 1
Scale: 0
_interpolation: 2
_extrapolation: 2
_enableTeleport: 0
_teleportThreshold: 1
_scaleThreshold: 1
_clientAuthoritative: 1
_sendToOwner: 1
_enableNetworkLod: 1
_interval: 1
_synchronizePosition: 1
_positionSnapping:
X: 0
Y: 0
Z: 0
_synchronizeRotation: 1
_rotationSnapping:
X: 0
Y: 0
Z: 0
_synchronizeScale: 1
_scaleSnapping:
X: 0
Y: 0
Z: 0
--- !u!1 &5839577311109879042
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2745247498903379289}
- component: {fileID: 3127415364279584095}
- component: {fileID: 5921142425762840611}
m_Layer: 0
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2745247498903379289
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5839577311109879042}
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: 4512293259955182957}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &3127415364279584095
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5839577311109879042}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &5921142425762840611
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5839577311109879042}
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: 143d8fe5f64b27d44a592f57d7949e1c, 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

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 300370bdf7819da41937e0beac65b32c
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c4bb86f41e1c4a84585e1ebef18ea9a7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 961b96636e4c7644584dc8dfd0d0aad6
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9f8d1e8e1482b84468258a26a4887d07
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,79 @@
using FishNet.Object;
using UnityEngine;
namespace FishNet.Demo.NetworkLod
{
public class MoveRandomly : NetworkBehaviour
{
[SerializeField]
private float _moveRate = 3f;
//Colors green for client.
[SerializeField]
private Renderer _renderer;
[SerializeField]
private bool _updateRotation;
//Maximum range for new position.
private const float _range = 10f;
//Position to move towards.
private Vector3 _goalPosition;
//Rotation to move towards.
private Quaternion _goalRotation;
//Position at spawn.
private Vector3 _startPosition;
private void Update()
{
//Client should not move these.
if (base.IsClientOnly)
return;
//Server shouldn't move client one.
if (base.Owner.IsValid)
return;
transform.position = Vector3.MoveTowards(transform.position, _goalPosition, _moveRate * Time.deltaTime);
if (_updateRotation)
transform.rotation = Quaternion.RotateTowards(transform.rotation, _goalRotation, 15f * Time.deltaTime);
if (transform.position == _goalPosition)
RandomizeGoal();
}
public override void OnStartNetwork()
{
_startPosition = transform.position;
RandomizeGoal();
if (_renderer != null && base.Owner.IsActive)
_renderer.material.color = Color.green;
if (!base.Owner.IsValid)
gameObject.name = "LOD " + base.ObjectId;
else
gameObject.name = "Owned " + base.ObjectId;
}
private void RandomizeGoal()
{
_goalPosition = _startPosition + (Random.insideUnitSphere * _range);
if (_updateRotation)
{
bool rotate = (Random.Range(0f, 1f) <= 0.33f);
if (rotate)
{
Vector3 euler = Random.insideUnitSphere * 180f;
_goalRotation = Quaternion.Euler(euler);
}
else
{
_goalRotation = transform.rotation;
}
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9880e85651efd71469092ce519317f7b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,74 @@
using FishNet.Managing.Observing;
using FishNet.Object;
using System.Collections.Generic;
using UnityEngine;
namespace FishNet.Demo.NetworkLod
{
public class NetworkLodTester : NetworkBehaviour
{
[Header("General")]
[SerializeField]
private NetworkObject _prefab;
[SerializeField]
private ObserverManager _observerManager;
[Range(1, 8)]
[SerializeField]
private byte _lodLevel = 8;
[Header("Spawning")]
[SerializeField]
private int _count = 500;
[SerializeField]
private float _xyRange = 15f;
[SerializeField]
private float _zRange = 100f;
private void Awake()
{
//Check for pro...this will stay false if not on a pro package.
bool isPro = false;
if (!isPro)
{
Debug.LogError($"Network Level of Detail demo requires Fish-Networking Pro to work.");
DestroyImmediate(this);
return;
}
List<float> distances = _observerManager.GetLevelOfDetailDistances();
while (distances.Count > _lodLevel)
distances.RemoveAt(distances.Count - 1);
}
public override void OnStartServer()
{
//Spawn objects going down the range to make it easier to debug.
float xySpacing = (_xyRange / _count);
float zSpacing = (_zRange / _count);
float x = 0f;
float y = 0f;
float z = 0f;
for (int i = 0; i < _count; i++)
{
//Z cannot be flipped.
float nextZ = z;
x += xySpacing;
y += xySpacing;
z += zSpacing;
float nextX = 0;
float nextY = 0;
Vector3 position = new Vector3(nextX, nextY, nextZ);
NetworkObject obj = Instantiate(_prefab, position, Quaternion.identity);
base.Spawn(obj);
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3e21cdbd259430f4ea77e1f3a6c88fc4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: