Example #1
0
        public void PlayState(State state, PersonDialog pd)
        {
            currentDialog = pd;
            if (onDialogChanged != null)
            {
                onDialogChanged.Invoke(pd);
            }
            onStateIn.Invoke(state);
            currentState = state;

            foreach (Path p in state.pathes.Where(p => p.auto))
            {
                if (PlayerResource.Instance.CheckCondition(p.condition))
                {
                    PlayPath(p);
                }
            }

            if (state.pathes.Where(p => PlayerResource.Instance.CheckCondition(p.condition)).Count() == 0)
            {
                if (onFinishDialog != null)
                {
                    onFinishDialog.Invoke();
                }
            }
        }
Example #2
0
 private void RaycastedMissed()
 {
     if (Person)
     {
         Person    = null;
         avaliable = true;
     }
 }
Example #3
0
        private void Raycasted(GameObject go, float distance)
        {
            if (distance > DialogDistance)
            {
                RaycastedMissed();
                return;
            }

            if (!go.GetComponent <PersonDialog>())
            {
                avaliable = true;
            }
            Person = go.GetComponent <PersonDialog>();
        }
Example #4
0
 public void PlayPath(Path p)
 {
     if (p.aimState != null)
     {
         PlayState(p.aimState, currentDialog);
         onPathGo.Invoke(p);
     }
     else
     {
         currentDialog.playing = false;
         currentDialog         = null;
         if (onDialogChanged != null)
         {
             onDialogChanged.Invoke(null);
         }
     }
 }
Example #5
0
 private void OnEnable()
 {
     dialog         = (PersonDialog)target;
     dialogObject   = new SerializedObject(dialog);
     dialogProperty = dialogObject.FindProperty("pathEvents");
 }