// Animancer // Copyright 2020 Kybernetik // #pragma warning disable CS0649 // Field is never assigned to, and will always have its default value. using UnityEngine; namespace Animancer.Examples.AnimatorControllers.GameKit { /// /// Base class for controlling the actions of a . /// [AddComponentMenu(Strings.MenuPrefix + "Examples/Game Kit - Creature Brain")] [HelpURL(Strings.APIDocumentationURL + ".Examples.AnimatorControllers.GameKit/CreatureBrain")] public abstract class CreatureBrain : MonoBehaviour { /************************************************************************************************************************/ [SerializeField] private Creature _Creature; public Creature Creature { get { return _Creature; } set { if (_Creature == value) return; var oldCreature = _Creature; _Creature = value; // Make sure the old creature doesn't still reference this brain. if (oldCreature != null) oldCreature.Brain = null; // Give the new creature a reference to this brain. if (value != null) value.Brain = this; } } /************************************************************************************************************************/ public Vector3 Movement { get; protected set; } /************************************************************************************************************************/ } }