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(); }
public override void execute() { animationToModify = LegacyEditorData.instance.currentAnimation; removedSubimage = animationToModify.subimages[indexToRemove]; animationToModify.subimages.RemoveAt(indexToRemove); LegacyEditorData.ChangedAnimation(); }
public override void execute() { animationToModify = LegacyEditorData.instance.currentAnimation; previousList = animationToModify.subimages; animationToModify.subimages = nextList; LegacyEditorData.ChangedAnimation(); }
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. }
public override void undo() { FighterInfo info = LegacyEditorData.instance.loadedFighter; info.GetVarByName(fighterVar).value = previousValue; LegacyEditorData.ChangedFighterData(); }
public override void execute() { prevAction = LegacyEditorData.instance.currentAction; prevCategory = LegacyEditorData.instance.subactionGroup; prevAction.subactionCategories.GetIfKeyExists(prevCategory).Remove(subDataToRemove); LegacyEditorData.instance.currentSubaction = null; LegacyEditorData.ChangedSubaction(); }
public void DeactivatePanel() { if (debug) { Debug.Log("Deactivating Panel", this); } LegacyEditorData.Banish(gameObject); FireContextualPanelChange(); }
void OnAnimationChanged(AnimationDefinition def) { if (LegacyEditorData.CurrentAnimationIsNew()) { label.text = "Create Animation"; } else { label.text = "Duplicate Animation"; } }
void OnActionChanged(DynamicAction action) { if (LegacyEditorData.CurrentActionIsNew()) { label.text = "Create New Action"; } else { label.text = "Duplicate Action"; } }
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(); }
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(); } }
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(); }
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(); } }
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(); }
public override void undo() { actionToAddTo.subactionCategories.GetIfKeyExists(groupToAddTo).Remove(subDataToAdd); LegacyEditorData.ChangedActionData(); }
public override void undo() { prevAction.subactionCategories.GetIfKeyExists(prevCategory).Add(subDataToRemove); LegacyEditorData.instance.currentSubaction = subDataToRemove; LegacyEditorData.ChangedSubaction(); }
public void DeleteImageDef() { editor.loadedSpriteInfo.imageDefinitions.Remove(editor.currentImageDef); editor.currentImageDef = null; LegacyEditorData.ChangedFighterData(); }
public void SetEditor(LegacyEditorData editor) { this.editor = editor; }
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. }
public override void undo() { LegacyEditorData.instance.loadedSpriteInfo.DeleteAnimation(animationToAdd); LegacyEditorData.ChangedActionFile(); }
public override void execute() { LegacyEditorData.instance.loadedSpriteInfo.AddAnimation(animationToAdd, false); LegacyEditorData.ChangedAnimation(); }
public override void undo() { actionToModify.subactionCategories.Set(subGroupToModify, previousList); LegacyEditorData.ChangedActionData(); }
public override void undo() { setActionVar(previousValue); LegacyEditorData.ChangedActionData(); }
public override void execute() { previousValue = getActionVar(); setActionVar(nextValue); LegacyEditorData.ChangedActionData(); }
public override void undo() { animationToModify.subimages.Insert(indexToRemove, removedSubimage); LegacyEditorData.ChangedAnimation(); }
public void Banish() { LegacyEditorData.Banish(gameObject); }
public void Unbanish() { LegacyEditorData.Unbanish(gameObject, intendedParent); }
public override void undo() { animationToModify.subimages = previousList; LegacyEditorData.ChangedAnimation(); }
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(); }
public override void undo() { setFighterVar(previousValue); LegacyEditorData.ChangedFighterData(); }