/// <summary> /// Return dialog instance using current instance as template. /// </summary> /// <returns>New Dialog instance.</returns> public Dialog Clone() { if ((TemplateName != null) && Templates.Exists(TemplateName)) { // do nothing } else if (!Templates.Exists(gameObject.name)) { Templates.Add(gameObject.name, this); } else if (Templates.Get(gameObject.name) != this) { Templates.Add(gameObject.name, this); } var id = gameObject.GetInstanceID().ToString(); if (!Templates.Exists(id)) { Templates.Add(id, this); } else if (Templates.Get(id) != this) { Templates.Add(id, this); } return(Templates.Instance(id)); }
/// <summary> /// Creates the template. /// </summary> static void CreateTemplate() { var template = new GameObject(key); var modal = template.AddComponent <ModalHelper>(); template.AddComponent <Image>(); Templates.Add(key, modal); }
/// <summary> /// Creates the template. /// </summary> static void CreateTemplate() { var template = new GameObject(key); var modal = template.AddComponent <ModalHelper>(); template.AddComponent <ModalGraphic>(); Templates.Add(key, modal); template.gameObject.SetActive(false); }
/// <summary> /// Creates the template. /// </summary> static void CreateTemplate() { var template = new GameObject(key); var modal = template.AddComponent <ModalHelper>(); template.AddComponent <Image>(); var le = template.AddComponent <LayoutElement>(); le.ignoreLayout = true; Templates.Add(key, modal); template.gameObject.SetActive(false); }
/// <summary> /// Adds the template. /// </summary> /// <param name="template">Template name.</param> /// <param name="notifyTemplate">Notify template object.</param> /// <param name="replace">If set to <c>true</c> replace.</param> static public void AddTemplate(string template, Notify notifyTemplate, bool replace = true) { Templates.Add(template, notifyTemplate, replace); }