public bool RemoveBehaviour <T> () where T : SteeringBehaviour
        {
            T t = FindBehaviour <T>();

            if (t != null)
            {
                SteeringBehaviour.Destroy(t);
                DeregisterBehaviour(t);
                return(true);
            }
            return(false);
        }
        internal void RegisterBehaviour(SteeringBehaviour behaviour)
        {
            if (behaviours == null)
            {
                behaviours = new Dictionary <BehaviourType, SteeringBehaviour>();
            }

            BehaviourType bt = behaviour.type;

            if (behaviours.ContainsKey(bt))
            {
                SteeringBehaviour.Destroy(behaviour);
                DeregisterBehaviour(behaviour);
            }
            behaviours[bt] = behaviour;
        }