private void AddAudioSource_OnCollected(ACollectable obj) { if (obj.tag == "Script") { if (this.source == null) { searchForSource(); } if (source.clip != clipScript) { source.clip = clipScript; } source.Play(); return; } if (obj.tag == "Can") { if (this.source == null) { searchForSource(); } if (source.clip != clipCan) { source.clip = clipCan; } source.Play(); } }
protected void checkDamage(ACollectable feature) { if (feature is DamageBoss1) { this.gotDamage(); this.droppedScriptAlive = false; } }
public void ShowFileName(Transform script) { ACollectable test = script.gameObject.GetComponent <ACollectable>(); if (test != null) { if (test.ShouldShowFileName()) { GameObject newGo = Instantiate(prefab); newGo.transform.parent = script; newGo.transform.localPosition = new Vector3(0f, offsetY, 0f); newGo.GetComponent <TextMesh>().text = test.GetFilename(); if (test.transform.name == "GoLeft" || test.transform.name == "CameraFeature") { newGo.AddComponent <TextVisualFader>(); } } } }
public void Trigger_Collected(ACollectable collected) { this.OnCollected?.Invoke(collected); this.AfterCollected?.Invoke(collected); }