Example #1
0
        /// <summary>
        /// Updates the visuals of this BoxUI node and any higher up BoxUI nodes based on what the currently selected actionTreeNode is
        /// </summary>
        /// <param name="actionTreeNode"></param>
        public void OnChangeActionTreePosition(ExNovoActionTreeNode actionTreeNode)
        {
            if (actionTreeNode == null)
            {
                Hide(true /*hide recursively*/);
                return;
            }
            if (actionTreeNode.IsRoot)
            {
                Hide(false /*not recursive, show the rest of the tree*/);
            }
            else
            {
                ChangeVisuals(actionTreeNode.ActionName, actionTreeNode.Color);
            }

            if (Next1 != null)
            {
                Next1.OnChangeActionTreePosition(actionTreeNode.Child(1));
            }
            if (Next2 != null)
            {
                Next2.OnChangeActionTreePosition(actionTreeNode.Child(2));
            }
            if (Next3 != null)
            {
                Next3.OnChangeActionTreePosition(actionTreeNode.Child(3));
            }
        }
Example #2
0
 public void OnInputSelect(int selectNumber)
 {
     if (CurrentTreeNode.HasChild(selectNumber))
     {
         CurrentTreeNode = CurrentTreeNode.Child(selectNumber);
         ExNovoBoxUIRoot.OnChangeActionTreePosition(CurrentTreeNode);
         ExNovoSoundPlayer.PlaySelectSound(selectNumber);
     }
     else
     {
         Debug.Log("Cannot traverse that way");
         ExNovoSoundPlayer.PlayErrorSound();
     }
 }