예제 #1
0
 private void Awake()
 {
     NPCPlayer = Player.Get(gameObject);
     AttachedCoroutines.Add(Timing.RunCoroutine(UpdateTalking()));
     AttachedCoroutines.Add(Timing.RunCoroutine(MoveCoroutine()));
     AttachedCoroutines.Add(Timing.RunCoroutine(NavCoroutine()));
     AttachedCoroutines.Add(Timing.RunCoroutine(AICoroutine()));
     Dictionary.Add(gameObject, this);
     Log.Debug($"Constructed NPC", Plugin.Instance.Config.VerboseOutput);
 }
예제 #2
0
 public void HandleAnswer(Player p, string answer)
 {
     if (!AIEnabled && !IsActionLocked)
     {
         AttachedCoroutines.Add(Timing.RunCoroutine(HandleAnswerCoroutine(p, answer)));
     }
     else
     {
         p.SendConsoleMessage($"[{Name}] {Plugin.Instance.Config.TranslationNpcBusy}", "yellow");
     }
 }
예제 #3
0
        private void OnDestroy()
        {
            Dictionary.Remove(this.gameObject);
            Timing.KillCoroutines(MovementCoroutines.ToArray());
            Timing.KillCoroutines(AttachedCoroutines.ToArray());

            Log.SendRaw($"NPC {NPCPlayer.Nickname} ({NPCPlayer.Id}) deconstructed", ConsoleColor.Green);

            Player.IdsCache.Remove(NPCPlayer.Id);
            Player.Dictionary.Remove(NPCPlayer.GameObject);
        }
예제 #4
0
 public void TalkWith(Player p)
 {
     AttachedCoroutines.Add(Timing.RunCoroutine(StartTalkCoroutine(p)));
 }