Exemplo n.º 1
0
        public override void Execute()
        {
            optionsPresenter = GameObject.GetComponent <OptionsPresenter>();
            optionsPresenter.ClearOptions();

            //
            if (optionsPresenter == null)
            {
                Debug.Log("You need to add an OptionsPresenter if you want to show options", GameObject);
                DoneDelegate(this);
                return;
            }

            // This node can have fluent nodes in it that are not options
            // We execute them first before handling the options
            childQueue.Clear();
            Children.ForEach(n =>
            {
                if (!(n is OptionNode))
                {
                    childQueue.Enqueue(n);
                }
            });

            if (childQueue.Count == 0)
            {
                optionsPresenter.SetupOptions(this);
            }
            else
            {
                HandleNextNode();
            }
        }
Exemplo n.º 2
0
        public override void Execute()
        {
            OptionsPresenter optionsPresenter = GameObject.GetComponent <OptionsPresenter>();

            if (optionsPresenter == null)
            {
                Debug.Log("You need to add an OptionsPresenter if you want to close it", GameObject);
                return;
            }
            optionsPresenter.End();
        }
Exemplo n.º 3
0
        public override void Execute()
        {
            if (gameObjectToHide != null)
            {
                gameObjectToHide.SetActive(false);
                Done();
                return;
            }

            OptionsPresenter optionsPresenter = GameObject.GetComponent <OptionsPresenter>();

            if (optionsPresenter == null)
            {
                Debug.Log("You need to add an OptionsPresenter if you want to hide it", GameObject);
                return;
            }
            optionsPresenter.Hide();
            Done();
        }
        public override void Execute()
        {
            if (gameObjectToShow != null)
            {
                gameObjectToShow.SetActive(true);
                Done();
                return;
            }

            OptionsPresenter optionsPresenter = GameObject.GetComponent <OptionsPresenter>();

            if (optionsPresenter == null)
            {
                Debug.Log("You need to add an OptionsPresenter if you want to show it", GameObject);
                return;
            }
            optionsPresenter.Show();
            Done();
        }