private void OnTap(object sender, OnTapEventArg e) { if (e.HitObject == null) { Ray r = Camera.main.ScreenPointToRay(e.TapPosition); Spawn(r.GetPoint(10)); } else { } }
private void FireTapEvent(Vector2 pos) { GameObject hitObj = GetHit(pos); //Debug.Log("Tap"); if (OnTap != null) { OnTapEventArg tapArgs = new OnTapEventArg(pos, hitObj); OnTap(this, tapArgs); } if (hitObj != null) { ITapped handler = hitObj.GetComponent <ITapped>(); if (handler != null) { handler.OnTap(); } } }