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); }
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"); } }
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); }
public void TalkWith(Player p) { AttachedCoroutines.Add(Timing.RunCoroutine(StartTalkCoroutine(p))); }