/////////////////////////////////////////////////////////////////////////////////////////////// void Awake() { foreach (GameObject crystal in this.crystals) { OnTriggerEnterListener listener = crystal.AddComponent <OnTriggerEnterListener>(); listener.onTriggerEnterDelegate = CrystalCollected; } }
/////////////////////////////////////////////////////////////////////////////////////////////// private void Awake() { foreach (GameObject button in this.buttons) { OnTriggerEnterListener listener = button.AddComponent <OnTriggerEnterListener>(); listener.onTriggerEnterDelegate = ButtonPressed; } }
/////////////////////////////////////////////////////////////////////////////////////////////// private void Awake() { this.animator = this.GetComponent <Animator>(); OnTriggerEnterListener listener = hitTrigger.AddComponent <OnTriggerEnterListener>(); listener.onTriggerEnterDelegate = OnHit; //this.target = player.transform.position; this.rotYTransform = this.transform.Find("RotationY"); this.bodyParts = this.gameObject.GetComponentsInChildren <Collider>(); }
public void EnrollBulletEnter(OnTriggerEnterListener onTriggerEnter) { _onTriggerEnterListener += onTriggerEnter; }