예제 #1
0
    // ===========================================================
    // Methods for/from SuperClass/Interfaces
    // ===========================================================

    // ===========================================================
    // Methods
    // ===========================================================

    void OnEnable()
    {
        layer = target as MadLevelBackgroundLayer;

        texture     = serializedObject.FindProperty("texture");
        tint        = serializedObject.FindProperty("tint");
        scaleMode   = serializedObject.FindProperty("scaleMode");
        scale       = serializedObject.FindProperty("scale");
        align       = serializedObject.FindProperty("align");
        position    = serializedObject.FindProperty("position");
        followSpeed = serializedObject.FindProperty("followSpeed");
        scrollSpeed = serializedObject.FindProperty("scrollSpeed");
    }
    // ===========================================================
    // Methods for/from SuperClass/Interfaces
    // ===========================================================

    // ===========================================================
    // Methods
    // ===========================================================
    
    void OnEnable() {
        layer = target as MadLevelBackgroundLayer;
    
        texture = serializedObject.FindProperty("texture");
        tint = serializedObject.FindProperty("tint");
        scaleMode = serializedObject.FindProperty("scaleMode");
		dontStretch = serializedObject.FindProperty("dontStretch");
		repeatX = serializedObject.FindProperty("repeatX");
		repeatY = serializedObject.FindProperty("repeatY");

        fillMarginLeft = serializedObject.FindProperty("fillMarginLeft");
        fillMarginTop = serializedObject.FindProperty("fillMarginTop");
        fillMarginRight = serializedObject.FindProperty("fillMarginRight");
        fillMarginBottom = serializedObject.FindProperty("fillMarginBottom");

        scale = serializedObject.FindProperty("scale");
        align = serializedObject.FindProperty("align");
        position = serializedObject.FindProperty("position");
        followSpeed = serializedObject.FindProperty("followSpeed");
        scrollSpeed = serializedObject.FindProperty("scrollSpeed");
    }
예제 #3
0
    // ===========================================================
    // Methods for/from SuperClass/Interfaces
    // ===========================================================

    // ===========================================================
    // Methods
    // ===========================================================

    void OnEnable()
    {
        layer = target as MadLevelBackgroundLayer;

        texture     = serializedObject.FindProperty("texture");
        tint        = serializedObject.FindProperty("tint");
        scaleMode   = serializedObject.FindProperty("scaleMode");
        dontStretch = serializedObject.FindProperty("dontStretch");
        repeatX     = serializedObject.FindProperty("repeatX");
        repeatY     = serializedObject.FindProperty("repeatY");

        fillMarginLeft   = serializedObject.FindProperty("fillMarginLeft");
        fillMarginTop    = serializedObject.FindProperty("fillMarginTop");
        fillMarginRight  = serializedObject.FindProperty("fillMarginRight");
        fillMarginBottom = serializedObject.FindProperty("fillMarginBottom");

        scale       = serializedObject.FindProperty("scale");
        align       = serializedObject.FindProperty("align");
        position    = serializedObject.FindProperty("position");
        followSpeed = serializedObject.FindProperty("followSpeed");
        scrollSpeed = serializedObject.FindProperty("scrollSpeed");
    }
예제 #4
0
    void MoveDown(MadLevelBackgroundLayer layer)
    {
        const string UndoName = "Move Layer Down";

        MadUndo.RecordObject(script, UndoName);
        MadUndo.LegacyRegisterSceneUndo(UndoName);

        int index = script.layers.IndexOf(layer);

        if (index < script.layers.Count - 1)
        {
            var temp = script.layers[index + 1];
            script.layers[index + 1] = layer;
            script.layers[index]     = temp;

            MadUndo.RecordObject(temp.gameObject, UndoName);
            MadUndo.RecordObject(layer.gameObject, UndoName);

            temp.SetDirty();
            layer.SetDirty();
        }

        script.UpdateDepth();
    }
예제 #5
0
    bool CanMoveDown(MadLevelBackgroundLayer layer)
    {
        int index = script.layers.IndexOf(layer);

        return(index < script.layers.Count - 1);
    }
예제 #6
0
    bool CanMoveUp(MadLevelBackgroundLayer layer)
    {
        int index = script.layers.IndexOf(layer);

        return(index > 0);
    }
예제 #7
0
 void MoveDown(MadLevelBackgroundLayer layer) {
     const string UndoName = "Move Layer Down";
 
     MadUndo.RecordObject(script, UndoName);
     MadUndo.LegacyRegisterSceneUndo(UndoName);
 
     int index = script.layers.IndexOf(layer);
     if (index < script.layers.Count - 1) {
         var temp = script.layers[index + 1];
         script.layers[index + 1] = layer;
         script.layers[index] = temp;
         
         MadUndo.RecordObject(temp.gameObject, UndoName);
         MadUndo.RecordObject(layer.gameObject, UndoName);
         
         temp.SetDirty();
         layer.SetDirty();
     }
     
     script.UpdateDepth();
 }
예제 #8
0
 bool CanMoveDown(MadLevelBackgroundLayer layer) {
     int index = script.layers.IndexOf(layer);
     return index < script.layers.Count - 1;
 }
예제 #9
0
 bool CanMoveUp(MadLevelBackgroundLayer layer) {
     int index = script.layers.IndexOf(layer);
     return index > 0;
 }
예제 #10
0
 public int IndexOf(MadLevelBackgroundLayer layer)
 {
     return(layers.IndexOf(layer));
 }
예제 #11
0
 public void RemoveLayer(MadLevelBackgroundLayer layer)
 {
     MadGameObject.SafeDestroy(layer.gameObject);
     layers.Remove(layer);
 }
예제 #12
0
 public int IndexOf(MadLevelBackgroundLayer layer) {
     return layers.IndexOf(layer);
 }
예제 #13
0
 public void RemoveLayer(MadLevelBackgroundLayer layer) {
     MadGameObject.SafeDestroy(layer.gameObject);
     layers.Remove(layer);
 }