void OnCriticalMemory()
 {
     m_CriticalSafeGuard = null;
     GC.Collect();
     m_Hub.Broadcast(new MemoryLevelChanged {
         Level = MemoryLevel.Critical
     });
     m_CurrentLevel = MemoryLevel.Critical;
     GC.Collect();
     m_CriticalSafeGuard = new byte[64 * k_Megabytes];
 }
Ejemplo n.º 2
0
    private void LevelSetup()
    {
        DOTween.Init();

        // Get references
        level = MemoryGameInfo.GetLevel(GameManager.Instance.GetCurrentDifficulty());

        secondsBetweenCubes = new WaitForSeconds(timeBetweenCubes);
        sound         = GetComponent <AudioSource>();
        meshRenderers = GetComponentsInChildren <MeshRenderer>();
        Debug.Log(meshRenderers[0].materials[colorMaterialIndex].name);
        originalColor = meshRenderers[0].materials[colorMaterialIndex].GetColor("_Color");
        totalCubes    = meshRenderers.Length;
    }
        void UpdateMemoryLevel()
        {
            var currentLevel = GetCurrentLevel();

            if (currentLevel != m_CurrentLevel)
            {
                m_Hub.Broadcast(new MemoryLevelChanged {
                    Level = currentLevel
                });
                m_CurrentLevel = currentLevel;

                if (currentLevel >= MemoryLevel.High)
                {
                    GC.Collect();
                }
            }
        }
Ejemplo n.º 4
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (memoryLevel_ != null)
            {
                hash ^= MemoryLevel.GetHashCode();
            }
            if (contentLength_ != null)
            {
                hash ^= ContentLength.GetHashCode();
            }
            if (CompressionLevel != global::Envoy.Config.Filter.Http.Gzip.V3Alpha.Gzip.Types.CompressionLevel.Types.Enum.Default)
            {
                hash ^= CompressionLevel.GetHashCode();
            }
            if (CompressionStrategy != global::Envoy.Config.Filter.Http.Gzip.V3Alpha.Gzip.Types.CompressionStrategy.Default)
            {
                hash ^= CompressionStrategy.GetHashCode();
            }
            hash ^= contentType_.GetHashCode();
            if (DisableOnEtagHeader != false)
            {
                hash ^= DisableOnEtagHeader.GetHashCode();
            }
            if (RemoveAcceptEncodingHeader != false)
            {
                hash ^= RemoveAcceptEncodingHeader.GetHashCode();
            }
            if (windowBits_ != null)
            {
                hash ^= WindowBits.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
        public override int GetHashCode()
        {
            int hash = 1;

            if (memoryLevel_ != null)
            {
                hash ^= MemoryLevel.GetHashCode();
            }
            if (contentLength_ != null)
            {
                hash ^= ContentLength.GetHashCode();
            }
            if (CompressionLevel != 0)
            {
                hash ^= CompressionLevel.GetHashCode();
            }
            if (CompressionStrategy != 0)
            {
                hash ^= CompressionStrategy.GetHashCode();
            }
            hash ^= contentType_.GetHashCode();
            if (DisableOnEtagHeader != false)
            {
                hash ^= DisableOnEtagHeader.GetHashCode();
            }
            if (RemoveAcceptEncodingHeader != false)
            {
                hash ^= RemoveAcceptEncodingHeader.GetHashCode();
            }
            if (windowBits_ != null)
            {
                hash ^= WindowBits.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Ejemplo n.º 6
0
 public WordKnowledge(int pairId, MemoryLevel memoryLevel, float complexity)
 {
     UserWordPairId = pairId;
     MemoryLevel    = memoryLevel;
     Complexity     = complexity;
 }