コード例 #1
0
 private void ClearVars()
 {
     HighlightedWears.Clear();
     WearsDataCache.Clear();
     lastAddedToCache  = null;
     firstElementCache = null;
     _modEnabled       = false;
     _needsFirstUpdate = false;
     isUpdatingAsync   = false;
 }
コード例 #2
0
        private static void UpdateDataCache(WearNTear wearNTear)
        {
            if (!WearsDataCache.ContainsKey(wearNTear))
            {
                WearsData wd = new WearsData();
                wd.pos = wearNTear.gameObject.transform.position;
                wd.healthPercentage = wearNTear.GetHealthPercentage();

                if (WearsDataCache.Count == 0)
                {
                    firstElementCache = wearNTear;
                }

                WearsDataCache.Add(wearNTear, wd);

                if (lastAddedToCache != null)
                {
                    lastAddedToCache.nextData = wearNTear;
                }

                lastAddedToCache = wd;
                CheckShouldDisposeData();
            }
        }