void OnEnable() { _completeActionRaised = false; Vector2 targetScale = _scaleToScreenSize.Simulate(false); var data = new ScaleData(transform, targetScale, scaleSpeed); _scaler = new ScalerFactory().Make(scaleType, data); }
private void ScaleDown() { if (clipOnProjectileSpawn != null) { MusicAudioPlayer.instance.PlayOneShot(clipOnProjectileSpawn); } var data = new ScaleData(transform, transform.localScale, scaleDownSpeed); _scaleDown = new ScalerFactory().Make(Scale.ScaleType.Down, data); }
/// <summary> /// Makes a Scaler based on specified type and data. /// </summary> /// <param name="type">Type of Scaler.</param> /// <param name="data">Data.</param> public Scaler Make(Scale.ScaleType type, ScaleData data) { Scaler scaler = null; if (type == Scale.ScaleType.Down) { scaler = new ScaleDown(data); } else { scaler = new ScaleUp(data); } return(scaler); }
public ScaleDown(ScaleData data) { _scaleData = data; }
public ScaleUp(ScaleData data) { _scaleData = data; }
private void ScaleDown() { var data = new ScaleData(transform, transform.localScale, scaleDownSpeed); _scaleDown = new ScalerFactory().Make(Scale.ScaleType.Down, data); }