Esempio n. 1
0
 public override void Init(SO_EnemyData _data, SO_Vector2 _spawnForce)
 {
     EnemyData            = _data;
     CurrentHp            = _data.Value.Hp;
     transform.localScale = new Vector3(_data.Value.Size, _data.Value.Size, 1);
     Rigidbody2D.velocity = new Vector2((Random.Range(0, 2) == 0 ? 1 : -1) * _data.Value.HorizontalVelocity, 0);
     StartCoroutine(SpawnEnemies());
 }
Esempio n. 2
0
 public override void Init(SO_EnemyData _data, SO_Vector2 _spawnForce)
 {
     EnemyData                = _data;
     CurrentHp                = _data.Value.Hp;
     transform.localScale     = new Vector3(_data.Value.Size, _data.Value.Size, 1);
     Rigidbody2D.gravityScale = _data.Value.GravityScale;
     Rigidbody2D.AddForce(_spawnForce.Value, ForceMode2D.Force);
 }
Esempio n. 3
0
 public override void Init(SO_EnemyData _data, SO_Vector2 _spawnForce)
 {
     EnemyData            = _data;
     CurrentHp            = _data.Value.Hp;
     transform.localScale = new Vector3(_data.Value.Size, _data.Value.Size, 1);
     Rigidbody2D.bodyType = RigidbodyType2D.Static;
     StartCoroutine(SpawnEnemies());
 }
Esempio n. 4
0
 public abstract void Init(SO_EnemyData _data, SO_Vector2 _spawnForce);