예제 #1
0
파일: MadFont.cs 프로젝트: tng2903/game1
 // ===========================================================
 // Methods
 // ===========================================================
 
 public override int GetHashCode() {
     var hash = new MadHashCode();
     hash.Add(texture);
     hash.Add(glyphs);
     hash.Add(linesCount);
     hash.Add(fillFactorTolerance);
     hash.Add(createStatus);
     hash.Add(created);
     hash.Add(material);
     hash.Add(dimensions);
     
     return hash.GetHashCode();
 }
예제 #2
0
    protected static int HashAddTextureArray(int current, Texture[] arr, string name = "")
    {
#if UNITY_EDITOR
        for (int i = 0; i < arr.Length; ++i)
        {
            string path = AssetDatabase.GetAssetPath(arr[i]);
            string guid = AssetDatabase.AssetPathToGUID(path);
            current = MadHashCode.Add(current, guid);
        }

        return(current);
#else
        return(MadHashCode.AddArray(current, arr));
#endif
    }
예제 #3
0
    private bool RebuildNeeded() {
        int ch = MadHashCode.FirstPrime;
        ch = MadHashCode.Add(ch, spriteBar != null ? spriteBar.GetInstanceID() : 0);
        ch = MadHashCode.Add(ch, spriteBarMaterial != null ? spriteBarMaterial.GetInstanceID() : 0);
        ch = MadHashCode.AddList(ch, spritesBackground);
        ch = MadHashCode.AddList(ch, spritesForeground);
        ch = MadHashCode.Add(ch, (int) spriteBarColorType);
        ch = MadHashCode.Add(ch, (int) growDirection);
        ch = MadHashCode.Add(ch, label);
        ch = MadHashCode.Add(ch, effectBurn);
        ch = MadHashCode.Add(ch, effectBurnSprite);
        ch = MadHashCode.Add(ch, rectTransform.pivot);
        ch = MadHashCode.Add(ch, effectTiled);
        ch = MadHashCode.Add(ch, effectTiledSprite);

        ch = MadHashCode.Add(ch, barImageRepeater);   // Cipsoft change

        //ch = HashAdd(ch, panel);
        //ch = HashAdd(ch, textureMode);
        //ch = HashAddArray(ch, texturesBackground);
        //ch = HashAddTexture(ch, textureBar);
        //ch = HashAddArray(ch, texturesForeground);
        //ch = HashAdd(ch, atlas);
        //ch = HashAddArray(ch, atlasTexturesBackground);
        //ch = HashAdd(ch, atlasTextureBarGUID);
        //ch = HashAddArray(ch, atlasTexturesForeground);
        //ch = HashAdd(ch, guiDepth);
        //ch = HashAdd(ch, growDirection);
        //ch = HashAdd(ch, effectBurn);
        //ch = HashAddTexture(ch, effectBurnTextureBar);
        //ch = HashAdd(ch, atlasEffectBurnTextureBarGUID);
        //ch = HashAdd(ch, labelEnabled);
        //ch = HashAdd(ch, labelFont);
        //ch = HashAdd(ch, effectFollow);
        //ch = HashAdd(ch, premultipliedAlpha);

        if (ch != lastRebuildHash || dirty) {
            lastRebuildHash = ch;
            dirty = false;
            return true;
        } else {
            return false;
        }
    }
예제 #4
0
    bool RebuildNeeded() {
        if (panel == null) {
            return false;
        }

        int ch = MadHashCode.FirstPrime;
        ch = MadHashCode.Add(ch, textureMode);

        ch = HashAdd(ch, panel);
        ch = HashAdd(ch, textureMode);
        ch = HashAddArray(ch, texturesBackground);
        ch = HashAddTexture(ch, textureBar);
        ch = HashAddArray(ch, texturesForeground);
        ch = HashAdd(ch, atlas);
        ch = HashAddArray(ch, atlasTexturesBackground);
        ch = HashAdd(ch, atlasTextureBarGUID);
        ch = HashAddArray(ch, atlasTexturesForeground);
        ch = HashAdd(ch, guiDepth);
        ch = HashAdd(ch, growDirection);
        ch = HashAdd(ch, effectBurn);
        ch = HashAddTexture(ch, effectBurnTextureBar);
        ch = HashAdd(ch, atlasEffectBurnTextureBarGUID);
        ch = HashAdd(ch, labelEnabled);
        ch = HashAdd(ch, labelFont);
        ch = HashAdd(ch, effectFollow);
        ch = HashAdd(ch, premultipliedAlpha);

        if (effectFollowObject != null && effectFollowObject is Texture) {
            ch = HashAddTexture(ch, effectFollowObject as Texture);
        } else {
            ch = HashAdd(ch, effectFollowObject);
        }
        
        //ch = HashAdd(ch, radialOffset);
        //ch = HashAdd(ch, radialLength);
        
        if (ch != lastRebuildHash || dirty) {
            lastRebuildHash = ch;
            dirty = false;
            return true;
        } else {
            return false;
        }
    }
예제 #5
0
    private bool RebuildNeeded() {
        if (panel == null) {
            return false;
        }

        var hash = new MadHashCode();

        hash.Add(textureMode);
        hash.Add(atlas);

        hash.Add(objectTexture);
        hash.Add(objectAtlasTextureGUID);

        hash.Add(objectAnchor);

        hash.AddEnumerable(texturesBackground);
        hash.AddEnumerable(atlasTexturesBackground);
        hash.AddEnumerable(texturesForeground);
        hash.AddEnumerable(atlasTexturesForeground);

        hash.Add(transformTranslate);
        hash.Add(transformRotate);
        hash.Add(transformScale);

        hash.Add(translateFunction);
        hash.Add(rotateFunction);
        hash.Add(scaleFunction);

        hash.Add(labelEnabled);
        hash.Add(labelFont);

        hash.Add(premultipliedAlpha);

        int hashNumber = hash.GetHashCode();

        if (hashNumber != lastRebuildHash || dirty) {
            lastRebuildHash = hashNumber;
            dirty = false;
            return true;
        } else {
            return false;
        }
    }
예제 #6
0
    private bool RebuildNeeded() {
        int ch = MadHashCode.FirstPrime;
        ch = MadHashCode.Add(ch, BuildVersion);
        ch = MadHashCode.Add(ch, spriteObject != null ? spriteObject.GetHashCode() : 0);
        ch = MadHashCode.AddList(ch, spritesBackground);
        ch = MadHashCode.AddList(ch, spritesForeground);
        ch = MadHashCode.Add(ch, spriteObjectPivot);
        ch = MadHashCode.Add(ch, label);
        ch = MadHashCode.Add(ch, effectBurn);
        ch = MadHashCode.Add(ch, effectBurnSprite);
        ch = MadHashCode.Add(ch, rectTransform.pivot);

        if (ch != lastRebuildHash || dirty) {
            lastRebuildHash = ch;
            dirty = false;
            return true;
        } else {
            return false;
        }
    }
예제 #7
0
 bool RebuildNeeded() {
     var hash = new MadHashCode();
     hash.AddEnumerable(texturesBackground);
     hash.Add(textureBar);
     hash.AddEnumerable(texturesForeground);
     hash.Add(guiDepth);
     hash.Add(growDirection);
     hash.Add(effectBurn);
     hash.Add(labelEnabled);
     hash.Add(labelFont);
     hash.Add(effectFollow);
     hash.Add(effectFollowObject);
     
     int hashNumber = hash.GetHashCode();
 
     if (hashNumber != lastRebuildHash || dirty) {
         lastRebuildHash = hashNumber;
         dirty = false;
         return true;
     } else {
         return false;
     }
 }
예제 #8
0
    bool RebuildNeeded() {
        if (panel == null) {
            return false;
        }

        var hash = new MadHashCode();
        hash.Add(textureMode);
        hash.Add(atlas);
            
        hash.AddEnumerable(texturesBackground);
        hash.AddEnumerable(atlasTexturesBackground);
        hash.AddEnumerable(texturesForeground);
        hash.AddEnumerable(atlasTexturesForeground);
        hash.Add(renderingMethod);
        hash.Add(gridTexture);
        hash.Add(gridAtlasTextureGUID);
        hash.AddEnumerable(sequenceTextures);
        hash.AddEnumerable(sequenceAtlasTexturesGUID);
        hash.Add(gridWidth);
        hash.Add(gridHeight);
        hash.Add(gridFrameCountManual);
        hash.Add(gridFrameCount);
        hash.Add(guiDepth);
        hash.Add(labelEnabled);
        hash.Add(labelFont);
        hash.Add(premultipliedAlpha);
        
        int hashNumber = hash.GetHashCode();
        
        if (hashNumber != lastRebuildHash || dirty) {
            lastRebuildHash = hashNumber;
            dirty = false;
            return true;
        } else {
            return false;
        }
    }
예제 #9
0
 bool RebuildNeeded() {
     var hash = new MadHashCode();
     hash.AddEnumerable(texturesBackground);
     hash.Add(textureIcon);
     hash.Add(textureSlot);
     hash.Add(repeatCount);
     hash.Add(repeatPositionDelta);
     hash.Add(guiDepth);
     hash.Add(growType);
     hash.Add(fillDirection);
     hash.Add(labelEnabled);
     hash.Add(labelFont);
     hash.Add(pivot);
     
     int hashNumber = hash.GetHashCode();
     
     if (hashNumber != lastRebuildHash || dirty) {
         lastRebuildHash = hashNumber;
         dirty = false;
         return true;
     } else {
         return false;
     }
 }
예제 #10
0
 protected static int HashAddArray(int current, object[] arr)
 {
     return(MadHashCode.AddArray(current, arr));
 }
예제 #11
0
 protected static int HashAdd(int current, object obj)
 {
     return(MadHashCode.Add(current, obj));
 }
예제 #12
0
    bool RebuildNeeded() {
        if (panel == null) {
            return false;
        }

        var hash = new MadHashCode();
        hash.Add(textureMode);
        hash.Add(atlas);
            
        hash.AddEnumerable(texturesBackground);
        hash.AddEnumerable(atlasTexturesBackground);
        hash.AddEnumerable(texturesForeground);
        hash.AddEnumerable(atlasTexturesForeground);
        hash.Add(renderingMethod);
        hash.Add(gridTexture);
        hash.Add(gridAtlasTextureGUID);
        hash.AddEnumerable(sequenceTextures);
        hash.AddEnumerable(sequenceAtlasTexturesGUID);
        hash.Add(gridWidth);
        hash.Add(gridHeight);
        hash.Add(gridFrameCountManual);
        hash.Add(gridFrameCount);
        hash.Add(guiDepth);
        hash.Add(labelEnabled);
        hash.Add(labelFont);
        hash.Add(premultipliedAlpha);
        
        int hashNumber = hash.GetHashCode();
        
        if (hashNumber != lastRebuildHash || dirty) {
            lastRebuildHash = hashNumber;
            dirty = false;
            return true;
        } else {
            return false;
        }
    }
예제 #13
0
    bool RebuildNeeded() {
        if (panel == null) {
            return false;
        }

        var hash = new MadHashCode();
        hash.AddEnumerable(texturesBackground);
        hash.Add(atlas);
        hash.Add(textureIcon);
        hash.Add(textureSlot);
        hash.Add(atlasTextureIconGUID);
        hash.Add(atlasTextureSlotGUID);
        hash.Add(repeatCount);
        hash.Add(repeatPositionDelta);
        hash.Add(guiDepth);
        hash.Add(growType);
        hash.Add(fillDirection);
        hash.Add(labelEnabled);
        hash.Add(labelFont);
        hash.Add(pivot);
        hash.Add(premultipliedAlpha);
        
        int hashNumber = hash.GetHashCode();
        
        if (hashNumber != lastRebuildHash || dirty) {
            lastRebuildHash = hashNumber;
            dirty = false;
            return true;
        } else {
            return false;
        }
    }
예제 #14
0
    private bool RebuildNeeded() {
        if (panel == null) {
            return false;
        }

        var hash = new MadHashCode();

        hash.Add(textureMode);
        hash.Add(atlas);

        hash.Add(objectTexture);
        hash.Add(objectAtlasTextureGUID);

        hash.Add(objectAnchor);

        hash.AddEnumerable(texturesBackground);
        hash.AddEnumerable(atlasTexturesBackground);
        hash.AddEnumerable(texturesForeground);
        hash.AddEnumerable(atlasTexturesForeground);

        hash.Add(transformTranslate);
        hash.Add(transformRotate);
        hash.Add(transformScale);

        hash.Add(translateFunction);
        hash.Add(rotateFunction);
        hash.Add(scaleFunction);

        hash.Add(labelEnabled);
        hash.Add(labelFont);

        hash.Add(premultipliedAlpha);

        int hashNumber = hash.GetHashCode();

        if (hashNumber != lastRebuildHash || dirty) {
            lastRebuildHash = hashNumber;
            dirty = false;
            return true;
        } else {
            return false;
        }
    }
예제 #15
0
 int ConfigurationHash() {
     var hash = new MadHashCode();
     hash.Add(bulletTextureOff);
     hash.Add(bulletTextureOn);
     hash.Add(hideManagedObjects);
     hash.Add(bulletDistance);
     hash.Add(guiDepth);
     if (draggable != null) {
         hash.Add(draggable.dragStopCount);
     }
     return hash.GetHashCode();
 }
예제 #16
0
    private int ComputeHash() {
        var hashCode = new MadHashCode();
        hashCode.Add(configuration);
        hashCode.Add(configurationGroup);
        hashCode.Add(hideManagedObjects);
        hashCode.Add(setupMethod);
        hashCode.Add(iconTemplate);
        hashCode.Add(iconScale);
        hashCode.Add(iconOffset);
        hashCode.Add(leftSlideSprite);
        hashCode.Add(leftSlideScale);
        hashCode.Add(leftSlideOffset);
        hashCode.Add(rightSlideSprite);
        hashCode.Add(rightSlideScale);
        hashCode.Add(rightSlideOffset);
        hashCode.Add(gridWidth);
        hashCode.Add(gridHeight);
        hashCode.Add(horizontalAlign);
        hashCode.Add(verticalAlign);
        hashCode.Add(pixelsWidth);
        hashCode.Add(pixelsHeight);
        hashCode.Add(pagesOffsetManual);
        hashCode.Add(pagesOffsetFromResolution);
        hashCode.Add(enumerationType);

        return hashCode.GetHashCode();
    }
예제 #17
0
        bool RebuildNeeded()
        {
            var hash = new MadHashCode();
            hash.AddEnumerable(texturesBackground);
            hash.Add(textureBar);
            hash.AddEnumerable(texturesForeground);
            hash.Add(guiDepth);
            hash.Add(growDirection);
            hash.Add(effectBurn);
            hash.Add(labelEnabled);
            hash.Add(labelFont);
            hash.Add(effectFollow);
            hash.Add(effectFollowObject);

            int hashNumber = hash.GetHashCode();

            if (hashNumber != lastRebuildHash || dirty) {
            lastRebuildHash = hashNumber;
            dirty = false;
            return true;
            } else {
            return false;
            }
        }
예제 #18
0
        public override int GetHashCode()
        {
            var hash = new MadHashCode();
            hash.Add(texture);
            hash.Add(color);

            return hash.GetHashCode();
        }