Example #1
0
 protected virtual void Start()
 {
     controller = new ControllerMainMenu(this);
     for (int i = 0; i < transform.childCount; i++)
     {
         transform.GetChild(i).GetComponent <IMenuSelection>();
     }
     current = transform.GetChild(_selectedOption).GetComponent <IMenuSelection>();
     current.Highlight();
 }
Example #2
0
 protected void Awake()
 {
     m_gameMachine   = IOC.Resolve <IGameMachine>();
     m_menu          = GetComponent <Menu>();
     m_globalUI      = IOC.Resolve <IGlobalUI>();
     m_menuSelection = IOC.Resolve <IMenuSelection>();
     m_audio         = IOC.Resolve <IAudio>();
     m_player        = IOC.Resolve <IPlayer>();
     AwakeOverride();
 }
Example #3
0
 private void Awake()
 {
     m_home          = GetComponentInChildren <Home>();
     m_lucky7        = GetComponentInChildren <Lucky7Engine.Lucky7>();
     m_menuSelection = IOC.Resolve <IMenuSelection>();
     m_player        = IOC.Resolve <IPlayer>();
     m_audio         = IOC.Resolve <IAudio>();
     SetGame(GetGame(m_menuSelection.Playground));
     m_menuSelection.Playground = Playground.LUCKY7;
     m_currentGame.Load();
 }
Example #4
0
 public virtual void Load()
 {
     if (m_menuSelection == null)
     {
         m_menuSelection = IOC.Resolve <IMenuSelection>();
     }
     if (m_audio == null)
     {
         m_audio = IOC.Resolve <IAudio>();
     }
     m_gameInstance = Instantiate(m_gamePrefab);
 }
Example #5
0
    void Highlighting()
    {
        if (transform.GetChild(_selectedOption).gameObject.activeSelf)
        {
            current = transform.GetChild(_selectedOption).GetComponent <IMenuSelection>();

            for (int i = 0; i < transform.childCount; i++)
            {
                transform.GetChild(i).GetComponent <IMenuSelection>().Unhighlight();
            }
            current.Highlight();
        }
    }
Example #6
0
 public virtual void Unload()
 {
     if (m_menuSelection == null)
     {
         m_menuSelection = IOC.Resolve <IMenuSelection>();
     }
     if (m_audio == null)
     {
         m_audio = IOC.Resolve <IAudio>();
     }
     if (m_gameInstance != null)
     {
         Destroy(m_gameInstance);
     }
 }
        ///-------------------------------------------------------------------------------------------------
        /// <summary>
        ///     Renders html to the specified writer.
        /// </summary>
        ///
        /// <param name="menuSelection">
        ///     The menu.
        /// </param>
        /// <param name="htmlHelper">
        ///     The HTML helper.
        /// </param>
        /// <param name="writer">
        ///     The writer.
        /// </param>
        ///-------------------------------------------------------------------------------------------------

        public void Render(IMenuSelection menuSelection, HtmlHelper htmlHelper, HtmlTextWriter writer)
        {
            if (this.Items.Count > 0)
            {
                if (this.Level == 0)
                {
                    this.CssClass = "level0 " + this.CssClass;
                }
                else
                {
                    this.CssClass = "level{0} ".FormatString(this.Level) + this.CssClass;
                }

                writer.AddAttribute(HtmlTextWriterAttribute.Class, this.CssClass);


                writer.RenderBeginTag("ul");
                for (int index = 0; index < this.Items.Count; index++)
                {
                    T item = this.Items[index];

                    if (!string.IsNullOrWhiteSpace(menuSelection.SelectedCssClass))
                    {
                        item.SelectedCssClass = menuSelection.SelectedCssClass;
                    }

                    if (menuSelection.SelectionMode.HasValue)
                    {
                        item.SelectionMode = menuSelection.SelectionMode.Value;
                    }

                    item.Level = this.Level + 1;
                    int childIndex = index;
                    if (childIndex == this.Items.Count - 1)
                    {
                        childIndex = -1;
                    }

                    item.ChildIndex = childIndex;
                    item.Render(htmlHelper, writer);
                }

                writer.RenderEndTag();
            }
        }