using UnityEngine; using System.Collections; [RequireComponent(typeof(Explodable))] public class ExplodeOnClick : MonoBehaviour { private Explodable _explodable; void Start() { _explodable = GetComponent(); } void OnMouseDown() { _explodable.explode(); ExplosionForce ef = GameObject.FindObjectOfType(); //ef.doExplosion(transform.position); Debug.Log("ExplosionForce At" + ef.transform.position); ef.doExplosion(ef.transform.position); } }