예제 #1
0
    public override ActionResult Execute(RAIN.Core.AI ai)
    {
        //MonoBehaviour.Destroy(ai.Body);
        ai.Body.gameObject.SendMessage("DestroyCar");

        SpawnAI spawnAI = ai.Body.GetComponentInChildren <SpawnAI>();

        spawnAI.Remove();

        /*Spawner myScript = GameObject.Find ("Spawner_01").GetComponentInChildren<Spawner>();
         * if (myScript.totalUnits > 0) {
         *      myScript.RemoveUnit ();
         *      //return ActionResult.SUCCESS;
         * }
         *
         * myScript = GameObject.Find ("Spawner_02").GetComponentInChildren<Spawner>();
         * if (myScript.totalUnits > 0) {
         *      myScript.RemoveUnit ();
         *      //return ActionResult.SUCCESS;
         * }
         *
         * myScript = GameObject.Find ("Spawner_03").GetComponentInChildren<Spawner>();
         * if (myScript.totalUnits > 0) {
         *      myScript.RemoveUnit ();
         *      //return ActionResult.SUCCESS;
         * }
         *
         * myScript = GameObject.Find ("Spawner_04").GetComponentInChildren<Spawner>();
         * if (myScript.totalUnits > 0) {
         *      myScript.RemoveUnit ();
         *      //return ActionResult.SUCCESS;
         * }*/

        return(ActionResult.SUCCESS);
    }
예제 #2
0
 void KillUnit()
 {
     ai.Remove();
 }