// Use this for initialization void Start() { //Just for testing because we don't have any way to set the campaign yet: Character[] characters = new[] { new Character("Alice", true), new Character("The evil lord zxqv", false) }; List <Coord> alicePickTiles = new List <Coord> { new Coord(0, 0), new Coord(0, 1), new Coord(1, 0) }; List <Coord> evilGuyPickTiles = new List <Coord> { new Coord(3, 7), new Coord(7, 4) }; Dictionary <Character, List <Coord> > validPickTiles = new Dictionary <Character, List <Coord> >(); validPickTiles[characters[0]] = alicePickTiles; validPickTiles[characters[1]] = evilGuyPickTiles; Level level = new Level("DemoMap", characters, null, validPickTiles); Campaign testCampaign = new Campaign("test", 0, new[] { level }); Persistance.campaign = testCampaign; //This will be encoded in the campaign. Somewhere. CutsceneCharacter blair = CutsceneCharacter.blair; CutsceneCharacter juniper = CutsceneCharacter.juniper; CutsceneScript script = new CutsceneScript(new List <CutsceneScriptLine> { new CutsceneScriptLine(CutsceneAction.SetBackground, background: CutsceneBackground.Academy), new CutsceneScriptLine(CutsceneAction.SetCharacter, character: blair, side: CutsceneSide.Left), new CutsceneScriptLine(CutsceneAction.SayDialogue, character: blair, dialogue: "My name is Blair!"), new CutsceneScriptLine(CutsceneAction.SetCharacter, character: juniper, side: CutsceneSide.Right), new CutsceneScriptLine(CutsceneAction.SayDialogue, character: juniper, dialogue: "and I'm Juniper."), new CutsceneScriptLine(CutsceneAction.SayDialogue, character: blair, dialogue: "There's a third major character, Bruno. He would've been here, but he got tied up with paperwork"), new CutsceneScriptLine(CutsceneAction.SayDialogue, character: juniper, dialogue: "Which is to say we ran out of budget"), new CutsceneScriptLine(CutsceneAction.SayDialogue, character: juniper, dialogue: "Anyways, I hope you enjoy this slick as h*ck demo"), new CutsceneScriptLine(CutsceneAction.TransitionOut, side: CutsceneSide.Right), new CutsceneScriptLine(CutsceneAction.TransitionOut, side: CutsceneSide.Left) }); cutscene.setup(script); //Actual constructor code. This should still be here after the demo :p playerCharacter = 0; battlefield = new Battlefield(); currentCharacter = -1; battleStage = BattleLoopStage.Initial; turnPlayerText.enabled = false; turnChangeBackground.enabled = false; victoryImage.enabled = false; defeatImage.enabled = false; getLevel(); deserializeMap(); }
private void txtTextScript_TextChanged(object sender, EventArgs e) { txtTextScriptHelper.Text = string.Join("\r\n", DicScripts.Keys); if (txtTextScript.Lines.Length == 0) { return; } int CurrentLineIndex = txtTextScript.GetLineFromCharIndex(txtTextScript.SelectionStart); string CurrentLine = txtTextScript.Lines[CurrentLineIndex]; string LineContent = CurrentLine; int IndexOfScriptName = CurrentLine.IndexOf(","); if (IndexOfScriptName >= 0) { LineContent = CurrentLine.Substring(0, IndexOfScriptName); } if (DicScripts.ContainsKey(LineContent)) { CutsceneScript ActiveScript = DicScripts[LineContent]; List <string> Output = new List <string>(); Output.Add(ActiveScript.Name); System.Reflection.PropertyInfo[] ScriptProperties = ActiveScript.GetType().GetProperties(); for (int i = 0; i < ScriptProperties.Length; ++i) { if (ScriptProperties[i].CanWrite) { if (ScriptProperties[i].PropertyType.IsArray) { object[] ArrayValue = (object[])ScriptProperties[i].GetValue(ActiveScript); Output.Add(ScriptProperties[i].Name + " (Val1,Val2,Val3,...)"); } else { Output.Add(ScriptProperties[i].Name); } } } txtTextScriptHelper.Text = string.Join(", ", Output); } }
private void OnEnable() { cutscene = (CutsceneScript)target; scene = serializedObject.FindProperty("parts"); list = new ReorderableList(serializedObject, scene) { displayAdd = false, displayRemove = false, draggable = true, drawHeaderCallback = rect => { EditorGUI.LabelField(rect, "Cutscene Parts"); } }; index = 0; //scene = serializedObject.FindProperty("newScene"); }
public void OnLoad(string data) { itemData = JsonUtility.FromJson <IData>(data); interactableDialogue = itemData.IinteractableDialogue; sr = itemData.Isr; handler = itemData.Ihandler; openedSprite = itemData.IopenedSprite; pd = itemData.Ipd; pm = itemData.Ipm; opened = itemData.Iopen; openedText = itemData.IopenedText; inside = itemData.isInside; if (opened) { this.GetComponent <SpriteRenderer>().sprite = openedSprite; } }
private void tsmCopyScriptAsText_Click(object sender, EventArgs e) { CutsceneScript ActiveScript = null; if (ActiveScriptType == ActiveScriptTypes.ActionScript) { ActiveScript = ActiveCutscene.DicActionScript[ActiveScriptIndex]; } else if (ActiveScriptType == ActiveScriptTypes.DataContainer) { ActiveScript = ActiveCutscene.ListDataContainer[ActiveScriptIndex]; } List <string> Output = new List <string>(); Output.Add(ActiveScript.Name); System.Reflection.PropertyInfo[] ScriptProperties = ActiveScript.GetType().GetProperties(); for (int i = 0; i < ScriptProperties.Length; ++i) { if (ScriptProperties[i].CanWrite) { if (ScriptProperties[i].PropertyType.IsArray) { object[] ArrayValue = (object[])ScriptProperties[i].GetValue(ActiveScript); Output.Add(string.Join(",", ArrayValue)); } else { Output.Add(ScriptProperties[i].GetValue(ActiveScript).ToString()); } } } Clipboard.SetText(string.Join(", ", Output)); ActiveScriptIndex = -1; }
public void InitScript(CutsceneScript NewScript) { NewScript.Lock(); NewScript.DrawImage(imgScriptTopLeft, 0, 0); NewScript.DrawImage(imgScriptMiddleLeft, 0, imgScriptTopLeft.ImageBase.Height, 0, NewScript.ScriptSize.Height - imgScriptTopMiddle.ImageBase.Height - imgScriptBottomMiddle.ImageBase.Height - 1); NewScript.DrawImage(imgScriptBottomLeft, 0, NewScript.ScriptSize.Height - imgScriptBottomLeft.ImageBase.Height); NewScript.DrawImage(imgScriptTopMiddle, imgScriptTopLeft.ImageBase.Width, 0, NewScript.ScriptSize.Width - imgScriptTopRight.ImageBase.Width - 1); NewScript.DrawImage(imgScriptMiddleMiddle, imgScriptMiddleLeft.ImageBase.Width, imgScriptTopLeft.ImageBase.Height, NewScript.ScriptSize.Width - imgScriptMiddleLeft.ImageBase.Width - imgScriptMiddleRight.ImageBase.Width - 1, NewScript.ScriptSize.Height - imgScriptTopMiddle.ImageBase.Height - imgScriptBottomMiddle.ImageBase.Height - 1); NewScript.DrawImage(imgScriptBottomMiddle, imgScriptBottomLeft.ImageBase.Width, NewScript.ScriptSize.Height - imgScriptBottomMiddle.ImageBase.Height, NewScript.ScriptSize.Width - imgScriptBottomLeft.ImageBase.Width - imgScriptBottomRight.ImageBase.Width - 1); NewScript.DrawImage(imgScriptTopRight, NewScript.ScriptSize.Width - imgScriptTopRight.ImageBase.Width, 0); NewScript.DrawImage(imgScriptMiddleRight, NewScript.ScriptSize.Width - imgScriptMiddleRight.ImageBase.Width, imgScriptTopRight.ImageBase.Height, 0, NewScript.ScriptSize.Height - imgScriptTopMiddle.ImageBase.Height - imgScriptBottomMiddle.ImageBase.Height - 1); NewScript.DrawImage(imgScriptBottomRight, NewScript.ScriptSize.Width - imgScriptBottomRight.ImageBase.Width, NewScript.ScriptSize.Height - imgScriptBottomRight.ImageBase.Height); NewScript.Unlock(); }
private void tsmCopy_Click(object sender, EventArgs e) { CutsceneScript NewScript = null; if (ActiveScriptType == ActiveScriptTypes.ActionScript) { NewScript = ActiveCutscene.DicActionScript[ActiveScriptIndex].CopyScript(ActiveCutscene); } else if (ActiveScriptType == ActiveScriptTypes.DataContainer) { NewScript = ActiveCutscene.ListDataContainer[ActiveScriptIndex].CopyScript(ActiveCutscene); } NewScript.ScriptSize.X = 0; NewScript.ScriptSize.Y = 0; InitScript(NewScript); if (NewScript is CutsceneDataContainer) { UInt32 NextID = 1; for (int S = ActiveCutscene.ListDataContainer.Count - 1; S >= 0; --S) { if (ActiveCutscene.ListDataContainer[S].Name == NewScript.Name) { NextID++; } } ((CutsceneDataContainer)NewScript).ID = NextID; ActiveCutscene.ListDataContainer.Add((CutsceneDataContainer)NewScript); } else { ActiveCutscene.AddActionScript((CutsceneActionScript)NewScript); } DrawScripts(); }
public void InitScript(CutsceneScript NewScript) { cutsceneViewer.InitScript(NewScript); }
private void SelectScript(CutsceneScript SelectedScript) { pgScriptProperties.SelectedObject = SelectedScript; }
//public PlayerMovement movscript; // Start is called before the first frame update void Start() { handler = GameObject.Find("/UI/VignetteController").GetComponent <CutsceneScript>(); gameTimeline = GameObject.Find("OpeningSceneManager").GetComponent <PlayableDirector>(); //movscript = GameObject.Find("Player").GetComponent<PlayerMovement>(); }
void Start() { handler = GameObject.Find("/UI/VignetteController").GetComponent <CutsceneScript>(); movscript = GameObject.Find("Player").GetComponent <PlayerMovement>(); mps.PlaySong("Sounds/Music/Floor_Mood", 1, true); }
public PackedCutscene(CutsceneScript cutscene) { cutsceneName = cutscene.name; parts = cutscene.parts; stopsBattle = cutscene.stopsBattle; }
// Start is called before the first frame update void Start() { handler = GameObject.Find("/UI/VignetteController").GetComponent <CutsceneScript>(); movscript = GameObject.Find("Player").GetComponent <PlayerMovement>(); pd = GameObject.Find("Player").GetComponent <PlayerData>(); }
// Start is called before the first frame update void Start() { handler = GameObject.Find("/UI/VignetteController").GetComponent <CutsceneScript>(); }