public void Init(MortarSettings settings, Vector3 startPos, SpawnPoint endPos, SpiderTank spiderTank) { _spiderTank = spiderTank; _spawn = endPos; _spawn.available = false; base.Init(settings, startPos); }
public void Init( MortarSettings settings, Vector3 startPos, SpawnPoint endPos, SpiderTank spiderTank ) { _spiderTank = spiderTank; _spawn = endPos; _spawn.available = false; base.Init( settings, startPos ); }
public void Init( MortarSettings settings, Vector3 startPos ) { _settings = settings; transform.position = startPos; // configure all the things _speed = Random.Range( _settings.minSpeed, _settings.maxSpeed ); _targetPos = new Vector3( startPos.x, _settings.arcHeight, startPos.z ); _speed = Random.Range( _settings.minSpeed, _settings.maxSpeed ); _velocity = Vector3.Normalize( _targetPos - transform.position ) * _speed; // calculate time to apex float timeToApex = Vector3.Distance( transform.position, _targetPos ) / _speed; Invoke( "OnMidComplete", timeToApex ); transform.rotation = Quaternion.LookRotation( Vector3.up ); }
public void Init(MortarSettings settings, Vector3 startPos) { _settings = settings; transform.position = startPos; // configure all the things _speed = Random.Range(_settings.minSpeed, _settings.maxSpeed); _targetPos = new Vector3(startPos.x, _settings.arcHeight, startPos.z); _speed = Random.Range(_settings.minSpeed, _settings.maxSpeed); _velocity = Vector3.Normalize(_targetPos - transform.position) * _speed; // calculate time to apex float timeToApex = Vector3.Distance(transform.position, _targetPos) / _speed; Invoke("OnMidComplete", timeToApex); transform.rotation = Quaternion.LookRotation(Vector3.up); }