Esempio n. 1
0
    void Start()
    {
        enemy.setTarget(GameObject.FindGameObjectWithTag("Player"));
        enemy.myClass = EnemyClass.unitTypes.WARRIOR;

        rb             = transform.GetComponent <Rigidbody2D> ();
        rb.constraints = RigidbodyConstraints2D.FreezeRotation;
    }
Esempio n. 2
0
    // 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;
    }