This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Mirror; | |
| /// <summary> | |
| /// A network behaviour that serializes SyncVars before SyncObjects (SyncList, SyncDictionary, etc), instead of the other way around. | |
| /// This is handy if you want the client to receive a sync var before processing operations to a sync list. | |
| /// </summary> | |
| public class ReverseNetworkBehaviour : NetworkBehaviour | |
| { | |
| readonly SyncList<int> _exampleList1 = new(); // Serialized/Deserialized 3rd | |
| readonly SyncList<int> _exampleList2 = new(); // Serialized/Deserialized 4th |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // IObjectRegistry.cs | |
| using System; | |
| using System.Collections.Generic; | |
| public interface IObjectRegistry<T> | |
| { | |
| IReadOnlyCollection<T> Instances { get; } | |
| event Action<T> OnInstanceRegistered; | |
| event Action<T> OnInstanceUnregistered; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| namespace UnityEditor | |
| { | |
| /// NOTE: This needs to be in an editor folder with an Assembly Definition Reference referencing | |
| /// the UnityEditor.UI assembly. This is because it uses internal extension methods which are inaccessible | |
| /// outside of UnityEditor.UI. | |
| [CustomEditor(typeof(LODGroup))] | |
| internal class LODGroupCustomEditor : LODGroupEditor | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using UnityEngine; | |
| using UnityEngine.Rendering; | |
| using UnityEngine.Rendering.Universal; | |
| using UnityEngine.XR; | |
| public class DynamicResolutionScaler : MonoBehaviour | |
| { | |
| [SerializeField, Range(0f, 1f)] float _minResolutionScale; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Normal.Realtime; | |
| using System; | |
| public abstract class BaseComponentRealtime<TModelRealtime> : RealtimeComponent<TModelRealtime> | |
| where TModelRealtime : RealtimeModel, new() | |
| { | |
| public bool IsOwnershipSupported => model.hasMetaModel; | |
| public bool PreventOwnershipTakeover | |
| { | |
| get => model.preventOwnershipTakeover; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Normal.Realtime; | |
| using System; | |
| using System.Collections; | |
| using System.Reflection; | |
| using UnityEngine; | |
| namespace Normcore.Realtime | |
| { | |
| /// <summary> | |
| /// This script is intended to be attached to an object with a RealtimeTransform in Rigidbody mode. We have to use reflection |