"AI_Core" (Ver.1.1)

This object is placed only in AI tanks.
AI system is composed of three objects "AI_Core", "AI_Eye" and "AI_Hand".
    "AI_Core" controls the driving and the firing of the tank.
    "AI_Eye" is used for serching the enemy tanks.
    "AI_Hand" is used for detecting an obstacle in front of the tank.

(Note.)
AI system requires Navigation Meshes (NavMesh) in the scene.

When you need to bake the NavMesh for your scene, please refer to the following Unity official manual.
https://docs.unity3d.com/Manual/nav-BuildingNavMesh.html

"AI_Eye" and "AI_Hand" must be placed under this object in the Hierarchy.
Also this object must be placed under the "MainBody" in the Hierarchy.
(Note.) Please take care not to change their hierarchy.

You can modify the behavior of the AI from "AI_Control_CS".
However most of the options can be set also from the "Spawner" in the scene.
Usually, you need not change the settings in this script.

(AI settings)
    [Waypoint Pack]
    Set the "Waypoint_Pack" in the scene.
    When this option is empty, the AI tank tries to stay in its initial position.

    [Waypoint Radius]
    The allowable range of each waypoint.
    When the AI tank enters this range, the AI updates its destination to the next waypoint.

    [Patrol Type]
    "0" = Random. The AI cruises the waypoints in random order.
    "1" = Order. The AI repeatedly cruises the waypoints in order.

    [No Attack]
    When this option is enabled, the AI never attack anything and never approach any enemy.
    This function is used in the demo scene "99_Training".

    [No Chase]
    When this option is enabled, the AI never chase any enemy even while firing.
    This function is used in the demo scene "05_Defence_Battle".

    [Visibility Radius]
    The radius of visibility range of the AI tank.
    The AI cannot find any enemy in the outside of the range.

    [Detect Count]
    The time period required for detecting the target.
    When the AI is too quick to detect the enemy, increase this value.

    [Approach Distance]
    The distance to the target that the AI tank will stop approaching.
    When the AI cannot aim the target by any obstacle, the AI will continue to approach the target even within this distance.
    (Tip.)
    When this value is set to Infinity (Type 'infinity' in the box.), the AI never approach the target.


    [Lost Count]
    The time period until the AI completely loses sight of the target.
    The AI follows the target within this time period even when the target gets out of sight.

    [Eye Transform]
    Assign "AI_Eye" under this object in the Hierarchy.

    [Hand Script]
    Assign "AI_Hand" under this object in the Hierarchy.

    [Obstacle Prefab]
    This prefab is instantiated when the AI tank gets stuck with other tanks, in order to find a new path.
    The prefab must have "Nav Mesh Obstacle" component.

    You can find the prefab "AI_Obstacle_Object" in the "Tank_Components" folder under the "Prefabs" folder.

    [NavMeshAgent Prefab]
    This prefab is instantiated at the opening, and it lead the AI tank like a pilot.
    The prefab must have "Nav Mesh Agent" component.

    You can find the prefab "AI_NavMeshAgent_Object" in the 'Tank_Components' folder under the "Prefabs" folder.

    [Agent Distance]
    The distance between the "AI_NavMeshAgent_Object" and the AI tank.
    The NavMeshAgent tries to lead the AI tank while keeping the distance.