コード例 #1
0
        protected void SwitchItem(DialogTopic.Item item)
        {
            CurrentHandler?.End();

            if (item == null)
            {
                Debug.LogError("Unable to handle dialog topic item NULL", CurrentState);
                Manager.Exit();
            }
            else
            {
                CurrentHandler = ItemHandler.PickHandler(item);

                if (CurrentHandler != null)
                {
                    CurrentHandler.Begin(this);
                }
                else
                {
                    Debug.LogError(string.Format("Unable to handle dialog topic item {0}", item), CurrentState);
                    Manager.Exit();
                }
            }
        }
コード例 #2
0
 public static ItemHandler PickHandler(DialogTopic.Item item)
 {
     return(HandlerFactory[item.GetType()](item));
 }