private static void PlayScene(iScene _scene) { if (Player == null) { return; } { NoPlayer(); } Player.LoadScene(_scene); CurrentScene = _scene; }
/// <summary>Construct the object</summary> /// <param name="scene">The scene to render.</param> /// <param name="flags">Miscellaneous flags</param> public Context(iScene scene, eCreateContextFlags flags = eCreateContextFlags.CacheCompiledShaders) { this.scene = scene; creationFlags = flags; }
public void LoadScene(iScene scene) { background.Image.sprite = Loader.Sprite(scene.BGImage); background.BGM.clip = Loader.AudioClip(scene.BGAudio); }
/// <summary> /// 结局处理 /// </summary> /// <param name="currentScene"></param> /// <param name="currentNode"></param> private static void BrunchEnd(iScene currentScene, iNode currentNode) { NextNode(currentNode); }
private void Init(XElement item, iScene scene) { owner = scene; type = (NodeType)Enum.Parse(typeof(NodeType), item.Attribute("NodeType").Value); #region NodeType //switch (item.Attribute("NodeType").Value) //{ // case "Sentence": // type = NodeType.Sentence; // break; // case "0": // type = NodeType.Sentence; // break; // case "句子": // type = NodeType.Sentence; // break; // case "Brunch": // type = NodeType.Brunch; // break; // case "1": // type = NodeType.Brunch; // break; // case "分支": // type = NodeType.Brunch; // break; // case "Option": // type = NodeType.Option; // break; // case "2": // type = NodeType.Option; // break; // case "选项": // type = NodeType.Option; // break; // case "End": // type = NodeType.End; // break; // case "3": // type = NodeType.End; // break; // case "结局": // type = NodeType.End; // break; // default: // type = NodeType.Sentence; // break; //} #endregion var _attribute = item.Attribute("ChangeBGImage"); if (_attribute != null) { changeBGImage = _attribute.Value; } _attribute = item.Attribute("ChangeBGM"); if (_attribute != null) { changeBGM = _attribute.Value; } _attribute = item.Attribute("Next"); if (_attribute != null) { next = _attribute.Value.ToInt(); } var collection = item.Elements("Brunch"); foreach (var Brunchitem in collection) { brunch[Brunchitem.Attribute("SubID").Value.ToInt()] = Brunchitem.Attribute("Next").Value.ToInt(); } collection = item.Elements("Sentence"); foreach (var sentence in collection) { iSentence _sentence = new Sentence(sentence); sentences[_sentence.SubID] = _sentence; } collection = item.Elements("Actor"); foreach (var actor in collection) { var _actor = new Actor(actor); actors.Add(_actor); } }
public Node(XElement item, iScene _s) { iD = item.Attribute("ID").Value.ToInt(); Init(item, _s); }