//using System.Collections; //using System.Collections.Generic; //using UnityEngine; //using QFramework; //using System; //using QFramework.Example; //using System.Linq; //public class TextQuestionAction : IAction //{ // public ulong ActionID { get; set; } // public bool Deinited { get; set; } // public bool Paused { get; set; } // public ActionStatus Status { get; set; } // private static readonly SimpleObjectPool mPool = // new SimpleObjectPool(() => new TextQuestionAction(), null, 10); // string title = string.Empty; // string options = string.Empty; // string answers = string.Empty; // string btns = string.Empty; // string wait = string.Empty; // string showAnswer = string.Empty; // string rightScore = string.Empty; // string errorScore = string.Empty; // string scoreName = string.Empty; // string absolutely = string.Empty; // string finishedEvent = string.Empty; // string optionType = null; // string des; // string cellSize; // public static TextQuestionAction Allocate(Dictionary datas, System.Action onDelayFinish = null) // { // var retNode = mPool.Allocate(); // retNode.ActionID = ActionKit.ID_GENERATOR++; // retNode.Deinited = false; // retNode.Reset(); // retNode.title = datas.ContainsKey("title") ? datas["title"] : string.Empty; // retNode.options = datas.ContainsKey("options") ? datas["options"] : string.Empty; // retNode.btns = datas.ContainsKey("btns") ? datas["btns"] : string.Empty; // retNode.answers = datas.ContainsKey("answers") ? datas["answers"] : string.Empty; // retNode.wait = datas.ContainsKey("wait") ? datas["wait"] : string.Empty; // retNode.showAnswer = datas.ContainsKey("showAnswer") ? datas["showAnswer"] : string.Empty; // retNode.rightScore = datas.ContainsKey("rightScore") ? datas["rightScore"] : string.Empty; // retNode.errorScore = datas.ContainsKey("errorScore") ? datas["errorScore"] : string.Empty; // retNode.scoreName = datas.ContainsKey("scoreName") ? datas["scoreName"] : string.Empty; // retNode.absolutely = datas.ContainsKey("absolutely") ? datas["absolutely"] : string.Empty; // retNode.finishedEvent = datas.ContainsKey("finishedEvent") ? datas["finishedEvent"] : string.Empty; // retNode.optionType = datas.ContainsKey("optionType") ? datas["optionType"] : "0"; // retNode.des = datas.ContainsKey("des") ? datas["des"] : string.Empty; // retNode.cellSize = datas.ContainsKey("cellSize") ? datas["cellSize"] : string.Empty; // return retNode; // } // public void Deinit() // { // if (!Deinited) // { // Deinited = true; // mPool.Recycle(this); // } // } // public void OnExecute(float dt) // { // } // public void OnFinish() // { // } // public void OnStart() // { // UITextQuestionData data = new UITextQuestionData(); // data.title = title; // data.options = options.Split('|').ToList(); // foreach (var item in answers.Split(',')) // { // data.answers.Add(item); // } // data.btns = btns.Split(',').ToList(); // float.TryParse(wait, out data.waitCloseTime); // bool.TryParse(showAnswer, out data.showAnswer); // data.finishedEvent = finishedEvent; // if (string.IsNullOrEmpty(scoreName) == false) // { // data.scoreName = scoreName; // float.TryParse(rightScore, out data.rightScore); // float.TryParse(errorScore, out data.errorScore); // bool.TryParse(absolutely, out data.absolutely); // } // int.TryParse(optionType, out data.OptionType); // data.des = des; // data.cellSize = cellSize; // UIKit.OpenPanelAsync(uiData: data, canvasLevel: UILevel.PopUI).ToAction().StartGlobal(() => this.Finish()); // } // public void Reset() // { // Status = ActionStatus.NotStart; // Paused = false; // } //}