fishnet installed
This commit is contained in:
@ -0,0 +1,74 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace FishNet.Managing.Predicting.Editing
|
||||
{
|
||||
|
||||
|
||||
[CustomEditor(typeof(PredictionManager), true)]
|
||||
[CanEditMultipleObjects]
|
||||
public class PredictionManagerEditor : Editor
|
||||
{
|
||||
private SerializedProperty _dropExcessiveReplicates;
|
||||
private SerializedProperty _maximumServerReplicates;
|
||||
private SerializedProperty _maximumConsumeCount;
|
||||
private SerializedProperty _redundancyCount;
|
||||
private SerializedProperty _allowPredictedSpawning;
|
||||
private SerializedProperty _reservedObjectIds;
|
||||
|
||||
|
||||
protected virtual void OnEnable()
|
||||
{
|
||||
_dropExcessiveReplicates = serializedObject.FindProperty("_dropExcessiveReplicates");
|
||||
_maximumServerReplicates = serializedObject.FindProperty("_maximumServerReplicates");
|
||||
_maximumConsumeCount = serializedObject.FindProperty("_maximumConsumeCount");
|
||||
_redundancyCount = serializedObject.FindProperty("_redundancyCount");
|
||||
_allowPredictedSpawning = serializedObject.FindProperty(nameof(_allowPredictedSpawning));
|
||||
_reservedObjectIds = serializedObject.FindProperty(nameof(_reservedObjectIds));
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
GUI.enabled = false;
|
||||
EditorGUILayout.ObjectField("Script:", MonoScript.FromMonoBehaviour((PredictionManager)target), typeof(PredictionManager), false);
|
||||
GUI.enabled = true;
|
||||
|
||||
EditorGUILayout.LabelField("Server", EditorStyles.boldLabel);
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(_dropExcessiveReplicates);
|
||||
EditorGUI.indentLevel++;
|
||||
if (_dropExcessiveReplicates.boolValue == true)
|
||||
{
|
||||
EditorGUILayout.PropertyField(_maximumServerReplicates);
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUILayout.PropertyField(_maximumConsumeCount);
|
||||
}
|
||||
EditorGUI.indentLevel--;
|
||||
EditorGUI.indentLevel--;
|
||||
|
||||
EditorGUILayout.LabelField("Client", EditorStyles.boldLabel);
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(_redundancyCount);
|
||||
EditorGUI.indentLevel--;
|
||||
|
||||
EditorGUILayout.PropertyField(_allowPredictedSpawning);
|
||||
if (_allowPredictedSpawning.boolValue == true)
|
||||
{
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(_reservedObjectIds);
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5382c1ab98f25c8439d23140d36651fe
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user