using UnityEngine;
using System.Collections;
[RequireComponent (typeof (Rigidbody))]
public class spacebarImpulse : MonoBehaviour {
void Start () {
}
void Update () {
if(Input.GetKeyDown(KeyCode.Space)) {
GameObject.Find("astar").GetComponent<AstarPath>().enabled = !GameObject.Find("astar").GetComponent<AstarPath>().enabled;
GameObject.Find("enemy1").GetComponent<AIFollow>().enabled = !GameObject.Find("enemy1").GetComponent<AIFollow>().enabled;
GameObject.Find("enemy2").GetComponent<AIFollow>().enabled = !GameObject.Find("enemy2").GetComponent<AIFollow>().enabled;
GameObject.Find("enemy3").GetComponent<AIFollow>().enabled = !GameObject.Find("enemy3").GetComponent<AIFollow>().enabled;
GameObject.Find("enemy4").GetComponent<AIFollow>().enabled = !GameObject.Find("enemy4").GetComponent<AIFollow>().enabled;
GameObject.Find("enemy5").GetComponent<AIFollow>().enabled = !GameObject.Find("enemy5").GetComponent<AIFollow>().enabled;
GameObject.Find("enemy6").GetComponent<AIFollow>().enabled = !GameObject.Find("enemy6").GetComponent<AIFollow>().enabled;
GameObject.Find("enemy7").GetComponent<AIFollow>().enabled = !GameObject.Find("enemy7").GetComponent<AIFollow>().enabled;
GameObject.Find("enemy8").GetComponent<AIFollow>().enabled = !GameObject.Find("enemy8").GetComponent<AIFollow>().enabled;
GameObject.Find("enemy9").GetComponent<AIFollow>().enabled = !GameObject.Find("enemy9").GetComponent<AIFollow>().enabled;
rigidbody.AddExplosionForce(100,transform.position,10);
}
}
}
Вот скрипт.
-----
Ну с одной стороны, серьезный настрой, это конечно хорошо, а с другой - ну вы чего, шуток не понимаете чтоли?