fishnet installed
This commit is contained in:
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6c1769e2b4cabd744a4b875f6849ef76
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,134 @@
|
||||
#if UNITY_EDITOR
|
||||
using FishNet.Editing;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace FishNet.Component.Transforming.Editing
|
||||
{
|
||||
|
||||
|
||||
[CustomEditor(typeof(NetworkTransform), true)]
|
||||
[CanEditMultipleObjects]
|
||||
public class NetworkTransformEditor : Editor
|
||||
{
|
||||
private SerializedProperty _componentConfiguration;
|
||||
private SerializedProperty _synchronizeParent;
|
||||
private SerializedProperty _packing;
|
||||
private SerializedProperty _interpolation;
|
||||
private SerializedProperty _extrapolation;
|
||||
private SerializedProperty _enableTeleport;
|
||||
private SerializedProperty _teleportThreshold;
|
||||
private SerializedProperty _clientAuthoritative;
|
||||
private SerializedProperty _sendToOwner;
|
||||
private SerializedProperty _synchronizePosition;
|
||||
private SerializedProperty _positionSnapping;
|
||||
private SerializedProperty _synchronizeRotation;
|
||||
private SerializedProperty _rotationSnapping;
|
||||
private SerializedProperty _synchronizeScale;
|
||||
private SerializedProperty _scaleSnapping;
|
||||
|
||||
|
||||
protected virtual void OnEnable()
|
||||
{
|
||||
_componentConfiguration = serializedObject.FindProperty(nameof(_componentConfiguration));
|
||||
_synchronizeParent = serializedObject.FindProperty("_synchronizeParent");
|
||||
_packing = serializedObject.FindProperty("_packing");
|
||||
_interpolation = serializedObject.FindProperty("_interpolation");
|
||||
_extrapolation = serializedObject.FindProperty("_extrapolation");
|
||||
_enableTeleport = serializedObject.FindProperty("_enableTeleport");
|
||||
_teleportThreshold = serializedObject.FindProperty("_teleportThreshold");
|
||||
_clientAuthoritative = serializedObject.FindProperty("_clientAuthoritative");
|
||||
_sendToOwner = serializedObject.FindProperty("_sendToOwner");
|
||||
_synchronizePosition = serializedObject.FindProperty("_synchronizePosition");
|
||||
_positionSnapping = serializedObject.FindProperty("_positionSnapping");
|
||||
_synchronizeRotation = serializedObject.FindProperty("_synchronizeRotation");
|
||||
_rotationSnapping = serializedObject.FindProperty("_rotationSnapping");
|
||||
_synchronizeScale = serializedObject.FindProperty("_synchronizeScale");
|
||||
_scaleSnapping = serializedObject.FindProperty("_scaleSnapping");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
GUI.enabled = false;
|
||||
EditorGUILayout.ObjectField("Script:", MonoScript.FromMonoBehaviour((NetworkTransform)target), typeof(NetworkTransform), false);
|
||||
GUI.enabled = true;
|
||||
|
||||
|
||||
#pragma warning disable CS0162 // Unreachable code detected
|
||||
EditorGUILayout.HelpBox(EditingConstants.PRO_ASSETS_LOCKED_TEXT, MessageType.Warning);
|
||||
#pragma warning restore CS0162 // Unreachable code detected
|
||||
|
||||
//Misc.
|
||||
EditorGUILayout.LabelField("Misc", EditorStyles.boldLabel);
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(_componentConfiguration);
|
||||
EditorGUILayout.PropertyField(_synchronizeParent, new GUIContent("* Synchronize Parent"));
|
||||
EditorGUILayout.PropertyField(_packing);
|
||||
EditorGUI.indentLevel--;
|
||||
EditorGUILayout.Space();
|
||||
|
||||
//Smoothing.
|
||||
EditorGUILayout.LabelField("Smoothing", EditorStyles.boldLabel);
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(_interpolation);
|
||||
EditorGUILayout.PropertyField(_extrapolation, new GUIContent("* Extrapolation"));
|
||||
EditorGUILayout.PropertyField(_enableTeleport);
|
||||
if (_enableTeleport.boolValue)
|
||||
{
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(_teleportThreshold);
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
EditorGUI.indentLevel--;
|
||||
EditorGUILayout.Space();
|
||||
|
||||
//Authority.
|
||||
EditorGUILayout.LabelField("Authority", EditorStyles.boldLabel);
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(_clientAuthoritative);
|
||||
if (!_clientAuthoritative.boolValue)
|
||||
{
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(_sendToOwner);
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
EditorGUI.indentLevel--;
|
||||
EditorGUILayout.Space();
|
||||
|
||||
//Synchronizing.
|
||||
EditorGUILayout.LabelField("Synchronizing.", EditorStyles.boldLabel);
|
||||
EditorGUI.indentLevel++;
|
||||
//Position.
|
||||
EditorGUILayout.PropertyField(_synchronizePosition);
|
||||
if (_synchronizePosition.boolValue)
|
||||
{
|
||||
EditorGUI.indentLevel += 2;
|
||||
EditorGUILayout.PropertyField(_positionSnapping);
|
||||
EditorGUI.indentLevel -= 2;
|
||||
}
|
||||
//Rotation.
|
||||
EditorGUILayout.PropertyField(_synchronizeRotation);
|
||||
if (_synchronizeRotation.boolValue)
|
||||
{
|
||||
EditorGUI.indentLevel += 2;
|
||||
EditorGUILayout.PropertyField(_rotationSnapping);
|
||||
EditorGUI.indentLevel -= 2;
|
||||
}
|
||||
//Scale.
|
||||
EditorGUILayout.PropertyField(_synchronizeScale);
|
||||
if (_synchronizeScale.boolValue)
|
||||
{
|
||||
EditorGUI.indentLevel += 2;
|
||||
EditorGUILayout.PropertyField(_scaleSnapping);
|
||||
EditorGUI.indentLevel -= 2;
|
||||
}
|
||||
EditorGUI.indentLevel--;
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3ed56c899b8ecf241a2bc3e40a2dabc1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a2836e36774ca1c4bbbee976e17b649c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: bf9191e2e07d29749bca3a1ae44e4bc8, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,13 @@
|
||||
namespace FishNet.Component.Transforming
|
||||
{
|
||||
|
||||
public enum SynchronizedProperty : byte
|
||||
{
|
||||
None = 0,
|
||||
Parent = 1,
|
||||
Position = 2,
|
||||
Rotation = 4,
|
||||
Scale = 8
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3e6005ee9abfdd542ad27023114bbe04
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user