Exemplo n.º 1
0
        /// <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));
        }
Exemplo n.º 2
0
        /// <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);
        }
Exemplo n.º 3
0
        /// <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);
        }
Exemplo n.º 4
0
        /// <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);
        }
Exemplo n.º 5
0
 /// <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);
 }