protected void SignalCallBack(object touchObject) { UITouchObject o = touchObject as UITouchObject; if (o != null) { ReturnInstantiatedObject("Touch_Effect", o.gameObject); } }
public void ShowEffect(Vector2 pos) { GameObject o = GetInstantiatedObject("Touch_Effect", m_pRootObject.transform); if (o != null) { UITouchObject touchObject = o.GetComponent <UITouchObject>(); touchObject.Activate(0.8f, SignalCallBack); RectTransform rt = o.GetComponent <RectTransform> (); rt.anchoredPosition = pos; o.SetActive(true); } }