public void UpdatePipeDragView(PointerEventData eventData, Vector3 startPos) { Vector3 position = Camera.main.ScreenToWorldPoint(eventData.position); int id = eventData.pointerId; GamePipeDragView dragView = GetPipeDrag(id); dragView.UpdatePipeDrag(startPos, position); }
// Use this for initialization void Start() { GamePipeDragViews = new ArrayList(maxTouchCount); for (int i = 0; i < maxTouchCount; i++) { GamePipeDragView pipeDragView = GamePipeDragView.CreatePipeDrag(pipeDragPrefab, pipeDragParent); GamePipeDragViews.Add(pipeDragView); } }
public static GamePipeDragView CreatePipeDrag(GameObject pipeDragPrefab, GameObject parent) { GameObject newPipeDragObject = Instantiate(pipeDragPrefab, Vector3.zero, Quaternion.identity); newPipeDragObject.transform.SetParent(parent.transform); GamePipeDragView component = newPipeDragObject.AddComponent <GamePipeDragView>(); component.gameObject.SetActive(false); return(component); }