void Start() { enemy.setTarget(GameObject.FindGameObjectWithTag("Player")); enemy.myClass = EnemyClass.unitTypes.WARRIOR; rb = transform.GetComponent <Rigidbody2D> (); rb.constraints = RigidbodyConstraints2D.FreezeRotation; }
// Use this for initialization void Start() { enemy.setTarget(GameObject.FindGameObjectWithTag("Player")); enemy.myClass = EnemyClass.unitTypes.RIFLE; idleImg = transform.FindChild("IdleImg").gameObject; fireImg = transform.FindChild("FireImg").gameObject; bulletSpawn = transform.FindChild("BulletSpawn").gameObject; rb = transform.GetComponent <Rigidbody2D> (); rb.constraints = RigidbodyConstraints2D.FreezeRotation; }