public override void OnInteract() { if (_caps.GetCaps() >= _price) { _soundEvents.PlayAudioClip(_soundEvents._tapSounds[3], _soundEvents._audioSourceTaps); _caps.DepriveCaps(_price); _panelCloser.OpenPanel(_codePanel); } else { _soundEvents.PlayAudioClip(_soundEvents._tapSounds[4], _soundEvents._audioSourceTaps); } }
public void SpawnCap() { _soundEvents.PlayAudioClip(_soundEvents._tapSounds[6], _soundEvents._audioSourceEvents); Vector3 pos = new Vector3(_spawnPoint.transform.position.x + Random.Range(-2f, 2f), _spawnPoint.transform.position.y + Random.Range(-1f, 1f)); Instantiate(_capPrefab, pos, Quaternion.identity, _parrentPoint); }
public override void OnInteract() { if (_caps.GetCaps() >= _price) { _soundEvents.PlayAudioClip(_soundEvents._tapSounds[3], _soundEvents._audioSourceTaps); _caps.DepriveCaps(_price); _caps.AddCapsPerTap(_growrh); _price = (int)(_price * 5.5f); _level++; Draw(); PlayerPrefs.SetInt(_name, _level); SaveContUps(); } else { _soundEvents.PlayAudioClip(_soundEvents._tapSounds[4], _soundEvents._audioSourceTaps); } }
public void GetReward() { if (!_isCollected) { _soundEvents.PlayAudioClip(_soundEvents._tapSounds[2], _soundEvents._audioSourceEvents); _isCollected = true; _animation.Play(); _caps.AddCap(_caps.GetCapsPerTaps() * 200); SaveCount(); Destroy(gameObject, 1f); } }