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()); }
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); }
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()); }
public abstract void Init(SO_EnemyData _data, SO_Vector2 _spawnForce);