コード例 #1
0
 public override void undo()
 {
     LegacyEditorData.instance.currentAction = previousAction;
     LegacyEditorData.instance.currentFrame  = previousFrame;
     LegacyEditorData.instance.loadedActionFile.actions.Insert(previousIndex, previousAction); //Add it back where it was
     LegacyEditorData.ChangedActionFile();
 }
コード例 #2
0
 public override void execute()
 {
     animationToModify = LegacyEditorData.instance.currentAnimation;
     removedSubimage   = animationToModify.subimages[indexToRemove];
     animationToModify.subimages.RemoveAt(indexToRemove);
     LegacyEditorData.ChangedAnimation();
 }
コード例 #3
0
 public override void execute()
 {
     animationToModify           = LegacyEditorData.instance.currentAnimation;
     previousList                = animationToModify.subimages;
     animationToModify.subimages = nextList;
     LegacyEditorData.ChangedAnimation();
 }
コード例 #4
0
    public override void execute()
    {
        FighterInfo info = LegacyEditorData.instance.loadedFighter;

        previousValue = info.GetVarByName(fighterVar).value;
        info.GetVarByName(fighterVar).value = nextValue;
        LegacyEditorData.ChangedFighterData(); //Fire the model changed method since we directly modified the fighter data instead of the model itself.
    }
コード例 #5
0
    public override void undo()
    {
        FighterInfo info = LegacyEditorData.instance.loadedFighter;

        info.GetVarByName(fighterVar).value = previousValue;

        LegacyEditorData.ChangedFighterData();
    }
コード例 #6
0
    public override void execute()
    {
        prevAction   = LegacyEditorData.instance.currentAction;
        prevCategory = LegacyEditorData.instance.subactionGroup;

        prevAction.subactionCategories.GetIfKeyExists(prevCategory).Remove(subDataToRemove);
        LegacyEditorData.instance.currentSubaction = null;
        LegacyEditorData.ChangedSubaction();
    }
コード例 #7
0
 public void DeactivatePanel()
 {
     if (debug)
     {
         Debug.Log("Deactivating Panel", this);
     }
     LegacyEditorData.Banish(gameObject);
     FireContextualPanelChange();
 }
コード例 #8
0
 void OnAnimationChanged(AnimationDefinition def)
 {
     if (LegacyEditorData.CurrentAnimationIsNew())
     {
         label.text = "Create Animation";
     }
     else
     {
         label.text = "Duplicate Animation";
     }
 }
コード例 #9
0
 void OnActionChanged(DynamicAction action)
 {
     if (LegacyEditorData.CurrentActionIsNew())
     {
         label.text = "Create New Action";
     }
     else
     {
         label.text = "Duplicate Action";
     }
 }
コード例 #10
0
    public override void execute()
    {
        //First we have to change to a null action, then we can delete the old one.
        previousAction = actionToDelete;
        previousFrame  = LegacyEditorData.instance.currentFrame;
        LegacyEditorData.instance.currentAction = new DynamicAction(""); //Set to a null action
        LegacyEditorData.instance.currentFrame  = 0;

        previousIndex = LegacyEditorData.instance.loadedActionFile.actions.IndexOf(actionToDelete);
        LegacyEditorData.instance.loadedActionFile.Delete(actionToDelete);
        LegacyEditorData.ChangedActionFile();
    }
コード例 #11
0
    public void setSubactionFromData()
    {
        SubactionData subaction = LegacyEditorData.instance.currentSubaction;

        if (subaction.SubactionName == "CreateHitbox")
        {
            subaction.arguments["centerX"].data = boxRect.center.x.ToString();
            subaction.arguments["centerY"].data = boxRect.center.y.ToString();
            subaction.arguments["width"].data   = boxRect.width.ToString();
            subaction.arguments["height"].data  = boxRect.height.ToString();
            LegacyEditorData.ChangedSubaction();
        }
    }
コード例 #12
0
    public override void execute()
    {
        actionToModify   = LegacyEditorData.instance.currentAction;
        subGroupToModify = LegacyEditorData.instance.subactionGroup;
        if (subGroupToModify == "Current Frame")
        {
            subGroupToModify = SubactionGroup.ONFRAME(LegacyEditorData.instance.currentFrame);
        }

        previousList = actionToModify.subactionCategories.GetIfKeyExists(subGroupToModify);
        actionToModify.subactionCategories.Set(subGroupToModify, nextList);

        LegacyEditorData.ChangedActionData();
    }
コード例 #13
0
    public void ActivatePanel()
    {
        if (debug)
        {
            Debug.Log("Activating Panel", this);
        }

        LegacyEditorData.Unbanish(gameObject);

        if (LegacyEditorData.contextualPanel != this)
        {
            LegacyEditorData.contextualPanel = this;
            //Since this activation gets called in the middle of an update, the panel we just activated isn't getting the function call.
            BroadcastMessage("OnModelChanged");
            FireContextualPanelChange();
        }
    }
コード例 #14
0
 public override void execute()
 {
     actionToAddTo = LegacyEditorData.instance.currentAction;
     groupToAddTo  = LegacyEditorData.instance.subactionGroup;
     Debug.Log("CreateNewSubaction actionToAddTo: " + actionToAddTo);
     Debug.Log("CreateNewSubaction groupToAddTo: " + groupToAddTo);
     //Since we don't want to add THIS subactionData, but a copy of it, we reinstance the scriptable object
     //subDataToAdd = Instantiate(subDataMaster) as SubactionData;
     if (groupToAddTo == "Current Frame")
     {
         groupToAddTo = SubactionGroup.ONFRAME(LegacyEditorData.instance.currentFrame);
         Debug.Log("Current Group: " + groupToAddTo);
     }
     subDataToAdd = subDataMaster.CreateSubactionData();
     actionToAddTo.subactionCategories.GetIfKeyExists(groupToAddTo).Add(subDataToAdd);
     Debug.Log(actionToAddTo.subactionCategories);
     LegacyEditorData.ChangedActionData();
 }
コード例 #15
0
 public override void undo()
 {
     actionToAddTo.subactionCategories.GetIfKeyExists(groupToAddTo).Remove(subDataToAdd);
     LegacyEditorData.ChangedActionData();
 }
コード例 #16
0
 public override void undo()
 {
     prevAction.subactionCategories.GetIfKeyExists(prevCategory).Add(subDataToRemove);
     LegacyEditorData.instance.currentSubaction = subDataToRemove;
     LegacyEditorData.ChangedSubaction();
 }
コード例 #17
0
 public void DeleteImageDef()
 {
     editor.loadedSpriteInfo.imageDefinitions.Remove(editor.currentImageDef);
     editor.currentImageDef = null;
     LegacyEditorData.ChangedFighterData();
 }
コード例 #18
0
 public void SetEditor(LegacyEditorData editor)
 {
     this.editor = editor;
 }
コード例 #19
0
 public override void execute()
 {
     previousValue = getFighterVar();
     setFighterVar(nextValue);
     LegacyEditorData.ChangedFighterData(); //Fire the model changed method since we directly modified the fighter data instead of the model itself.
 }
コード例 #20
0
 public override void undo()
 {
     LegacyEditorData.instance.loadedSpriteInfo.DeleteAnimation(animationToAdd);
     LegacyEditorData.ChangedActionFile();
 }
コード例 #21
0
 public override void execute()
 {
     LegacyEditorData.instance.loadedSpriteInfo.AddAnimation(animationToAdd, false);
     LegacyEditorData.ChangedAnimation();
 }
コード例 #22
0
 public override void undo()
 {
     actionToModify.subactionCategories.Set(subGroupToModify, previousList);
     LegacyEditorData.ChangedActionData();
 }
コード例 #23
0
 public override void undo()
 {
     setActionVar(previousValue);
     LegacyEditorData.ChangedActionData();
 }
コード例 #24
0
 public override void execute()
 {
     previousValue = getActionVar();
     setActionVar(nextValue);
     LegacyEditorData.ChangedActionData();
 }
コード例 #25
0
 public override void undo()
 {
     animationToModify.subimages.Insert(indexToRemove, removedSubimage);
     LegacyEditorData.ChangedAnimation();
 }
コード例 #26
0
 public void Banish()
 {
     LegacyEditorData.Banish(gameObject);
 }
コード例 #27
0
 public void Unbanish()
 {
     LegacyEditorData.Unbanish(gameObject, intendedParent);
 }
コード例 #28
0
 public override void undo()
 {
     animationToModify.subimages = previousList;
     LegacyEditorData.ChangedAnimation();
 }
コード例 #29
0
    private void SliceOne(FileInfo spriteImage)
    {
        Texture2D cachedTextureFile = FileLoader.LoadTexture(spriteImage.FullName);

        int xIndex         = 0;
        int yIndex         = 0;
        int currentXOffset = 0;
        int currentYOffset = 0;

        int   xSpacing = int.Parse(offsetXString);
        int   ySpacing = int.Parse(offsetYString);
        int   width    = int.Parse(frameWidthString);
        int   height   = int.Parse(frameHeightString);
        float pivotX   = float.Parse(pivotXString);
        float pivotY   = float.Parse(pivotYString);

        //Pixels per unit must be at least 1.
        int pixelsPerUnit = Mathf.Max(1, int.Parse(ppuString));

        //If height or width is zero, use the full image size instead
        if (width == 0)
        {
            width = cachedTextureFile.width;
        }
        if (height == 0)
        {
            height = cachedTextureFile.height;
        }

        //For the sake of cleanliness, we define this animation up here, but only add it to the animation list if the flag is set
        AnimationDefinition animation = new AnimationDefinition(Path.GetFileNameWithoutExtension(spriteImage.Name), 1, false);

        //Go through the image vertically
        while (currentYOffset <= cachedTextureFile.height - height)
        {
            //Go through the image horizontally
            while (currentXOffset <= cachedTextureFile.width - width)
            {
                //Create the image definition
                ImageDefinition imageDef = new ImageDefinition();
                imageDef.SpriteFileName = spriteImage.Name;
                imageDef.ImageName      = Path.GetFileNameWithoutExtension(spriteImage.Name) + "_" + (xIndex + yIndex);
                imageDef.OffsetX        = currentXOffset;
                imageDef.OffsetY        = currentYOffset;
                imageDef.Width          = width;
                imageDef.Height         = height;
                imageDef.Pivot          = new AnchorPointData("Pivot", pivotX, pivotY, AnchorPointData.RELATIVE);
                animation.subimages.Add(imageDef.ImageName);

                editor.loadedSpriteInfo.imageDefinitions.Add(imageDef);

                //Advance the horizontal counter
                currentXOffset += width + xSpacing;
                xIndex++;
            }

            //Advance the vertical counter
            currentYOffset += height + ySpacing;
            yIndex++;
        }
        //If generate animations is checked, add an animation for this image. It won't overwrite so it'll append _new if it exists already
        if (generateAnimations)
        {
            editor.loadedSpriteInfo.AddAnimation(animation, false);
        }

        LegacyEditorData.ChangedSpriteInfo();
    }
コード例 #30
0
 public override void undo()
 {
     setFighterVar(previousValue);
     LegacyEditorData.ChangedFighterData();
 }