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()); }
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); }
public CodeReader(char *chars, int start, int length, CodeReader baseReader) { this.chars = chars; index = start; end = start + length; ProcessCaches = baseReader.ProcessCaches; MethodCaches = baseReader.MethodCaches; }
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); } }
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>(); } }
private void Start() { agent = GetComponent <NavMeshAgent>(); IdCache.CacheInstanceId(GetInstanceID(), this); }
public static int GetSerializationId(this ILexical element) { Validate.NotNull(element, nameof(element)); return(IdCache.GetOrAdd(element, System.Threading.Interlocked.Increment(ref idGenerator))); }