Exemplo n.º 1
0
        private void OnDisable()
        {
            // Unsubscribe all overloaded methods with their respective events
            RelativeEventHandler.UnsubscribeEvent("Heal", this, "Heal");
            RelativeEventHandler.UnsubscribeEvent("Damage", this, "Damage");

            // Remove the instance Id
            IdCache.RemoveInstanceId(GetInstanceID());
        }
Exemplo n.º 2
0
        private void OnEnable()
        {
            // Subscribe all overloaded methods with their respective events
            RelativeEventHandler.SubscribeEvent("Heal", this, "Heal");
            RelativeEventHandler.SubscribeEvent("Damage", this, "Damage");

            // Cache the instance Id
            IdCache.CacheInstanceId(GetInstanceID(), this);
        }
Exemplo n.º 3
0
        public CodeReader(char *chars, int start, int length, CodeReader baseReader)
        {
            this.chars = chars;

            index = start;

            end = start + length;

            ProcessCaches = baseReader.ProcessCaches;
            MethodCaches  = baseReader.MethodCaches;
        }
Exemplo n.º 4
0
        public CodeReader(char *chars, int start, int length)
        {
            this.chars = chars;

            index = start;

            end = start + length;

            ProcessCaches = new IdCache <ProcessCacheItem>();
            MethodCaches  = new IdCache <MethodCacheItem>();
        }
            static Impl()
            {
                Interfaces = new IdCache <IValueInterface <T> >();

                Instance = new Impl <T>();

                lock (Impls)
                {
                    Impls.Add(Instance);
                }
            }
Exemplo n.º 6
0
        public JsonSerializer(JsonFormatterOptions options, int maxDepth)
        {
            this.options = options;

            this.maxDepth = maxDepth;

            offset = 0;

            hGlobal = HGlobalChars.ThreadInstance;

            Expand(255);

            if ((options & (JsonFormatterOptions.MultiReferencingNull | JsonFormatterOptions.MultiReferencingReference)) != 0)
            {
                objectIds = new IdCache <int>();
            }
        }
Exemplo n.º 7
0
 private void Start()
 {
     agent = GetComponent <NavMeshAgent>();
     IdCache.CacheInstanceId(GetInstanceID(), this);
 }
Exemplo n.º 8
0
 public static int GetSerializationId(this ILexical element)
 {
     Validate.NotNull(element, nameof(element));
     return(IdCache.GetOrAdd(element, System.Threading.Interlocked.Increment(ref idGenerator)));
 }