public void OnClick() { SoundRandomiser instance = Instantiate(_prefabSoundRandomiser); instance.Play(); Destroy(transform.parent.gameObject); }
private void Start() { if (TimeShifter.CurrentEra != (int)Era.Renaissance && TimeShifter.CurrentEra != (int)Era.Hackerman) { Destroy(gameObject); } _audioSource = GetComponent <SoundRandomiser>(); GetComponent <Image>().sprite = _icons.list[TimeShifter.CurrentEra]; }