"Event_Controller" (Ver.2.5)



(Outline)
"Event Controller" is used for generating various events in the game scene, such as spawning a tank, changing AI settings and showing a message.
You can find various Event_Controllers having various names in the sample scenes.


"Event_Controller_CS(Script)"
(Notice.) At first, choose the "Trigger Type".

(Trigger Type == "Timer")

    [Trigger Type]
    "Timer" = When the specified time passes, the event is generated.

    [Trigger Time]
    When this time period passes after this Event Controller is enabled, the event is generated.


(Trigger Type == "Destroy")

    [Trigger Type]
    "Destroy" = When the specified tank is destroyed, the event is generated.

    [Number of Trigger Tanks]
    Set the number of tanks that should be destroyed.

    [Trigger Tank]
    Set the tank that should be destroyed.

    [Operator Type]
    "AND" = When all the Trigger_Tanks are destroyed, the event is generated.
    "OR" = When one of the Trigger_Tanks is destroyed, the event is generated.

    [Require All the Triggers] (only for "AND")
    When this is enabled, all the Trigger_Tanks should be destroyed to generate the event.

    [Number of Necessary Triggers] (only when the "Require All the Triggers" is disabled)
    Set the necessary number of the Trigger_Tanks that should be destroyed to generate the event.


(Trigger Type == "Trigger Collider")

    [Trigger Type]
    "Trigger Collider" = When the specified tank touches the specified Trigger Collider, the event is generated.

    [Number of Trigger Colliders]
    [Trigger Collider]
    When the specified tank touches this "Trigger Collider", the event is generated.

    [Trigger Setting Type]
    "Set Manually" = Set the trigger tanks manually.
    "Any Hostile Tank" = When any hostile tank touches the collider, the event is generated.
    "Any Friendly Tank" = When any friendly tank touches the collider, the event is generated.

    [Number of Trigger Tanks] (only for "Set Manually")
    Set the number of tanks that should touch the collider.

    [Trigger Tank]
    Set the tank that should touch the collider.

    [Operator Type]
    "AND" = When all the Trigger_Tanks touch the collider, the event is generated.
    "OR" = When one of the Trigger_Tanks touches the collider, the event is generated.

    [Require All the Triggers] (only for "AND")
    When this is enabled, all the Trigger_Tanks should touch the collider to generate the event.

    [Number of Necessary Triggers] (only when "Require All the Triggers" is disabled)
    Set the necessary number of the Trigger_Tanks that should touch the collider to generate the event.



(Notice.) Next, choose the "Event Type".

(Event Type == "Spawn Tank")

    [Event Type]
    "Spawn Tank" = The assigned tank is spawned in this position.

(Tank Settings)
    [Tank Prefab]
    Set the tank prefab to be spawned.
    (Notice.)
    Tank prefabs must be placed under 'Resources' folder to be spawned.


    [Key Name] (New)
    Input the name of the dropdown prepared for this tank in the menu scene.
    Please read also "Canvas_Dropdown".
    When this value is empty or wrong, the tank assigned in the "Tank Prefab" is spawned.

    [ +++ Other settings for the tank +++ ]
    These settings are same as the settings in "Top object of tank ".


(Event Type == "Show Message")

    [Event Type]
    "Show Message" = The text is displayed in the assigned 'Text' object in the scene.

(Message Settings)
    [Text]
    Assign the 'Text' object in the scene.
    The 'Text' objects are placed under the "Canvas_Message" in the sample scenes.
    And input the message as you will.

    [Color]
    [Displaying Time]
    Set them as you like.


(Event Type == "Change AI Settings")

    [Event Type]
    "Change AI Settings" = The AI settings of the assigned AI tank are overwritten by new settings.

    [Target is trigger itself.] (only when the "Trigger Type" is set to "Trigger Collider")
    When this is enabled, the AI settings of the Trigger_Tank that touches the Trigger_Collider are overwritten.

    [Number of Target Tanks] (only when the "Target is trigger itself" is disabled)
    [Target Tank]
    Set the AI tank that its AI settings should be overwritten.

(New AI Settings)
     [ +++ New AI settings +++ ]
    These settings are same as the settings in "Top object of tank".


(Event Type == "Remove Tank")

    [Event Type]
    "Remove" = Remove the assigned tank from the scene.

    [Target is trigger itself] (only when the "Trigger Type" is set to "Trigger Collider")
    When this is enabled, the Trigger_Tank that touches the Trigger_Collider is removed from the scene.   

    [Number of Target Tanks] (only when the "Target is trigger itself" is disabled)
    [Target Tank]
    Set the tank should be removed from the scene.


(Event Type == "Artillery Fire")

    [Event Type]
    "Artillery Fire" = Call the artillery fire in the scene.

    [Artillery Object]
    Set the "Artillery" object in the scene.

    [Target]
    Set the target of the artillery fire.

    [Number of Shells]
    Set the number of shells fired at one time.


(Event Type == "Destroy Tank") (New)

    [Event Type]
    "Destroy Tank" = Destroy the assigned tank.

    [Target is trigger itself] (only when the "Trigger Type" is set to "Trigger Collider")
    When this is enabled, the Trigger_Tank that touches the Trigger_Collider is destroyed.   

    [Number of Target Tanks] (only when the "Target is trigger itself" is disabled)
    [Target Tank]
    Set the tank should be destroyed.


(Common options)

(Other Event Settings)
    [Number of Events to be Removed]
    [Event to be Removed]
    Set the event that should be removed from the scene after this event is generated.

    [Number of Events to be Enabled]
    [Event to be Enabled]
    Set the disabled event that should be enabled after this event is generated.
    (Notice.)
    When you want to create a waiting event, disable its "Event_Controller_CS(Script)".
    Please do not disable (inactivate) the GameObject.