public void OnPointerClick(PointerEventData eventData) { if (RectTransformUtility.RectangleContainsScreenPoint(emotionShapeRect, eventData.position)) { EmotionVectorHandle handle = InstantiateHandle(); handle.RectTransform.position = new Vector3(eventData.position.x, eventData.position.y, 0f); } }
private EmotionVectorHandle InstantiateHandle() { EmotionVectorHandle handle = GameObject.Instantiate <EmotionVectorHandle>(emotionHandlePrefab); handle.RectTransform.SetParent(rect, true); handle.Initialize(this, emotionShapeRect); handles.Add(handle); return(handle); }
protected override void OnInitialize() { variantToggle.isOn = Chunk.IsVariation; harmonySequenceInputField.text = Chunk.HarmonySequenceNumber.ToString(); curveDropdown.value = (int)Chunk.IntensityCurveType; intensityInputField.text = Chunk.Data.intensityMultiplier.ToString(); ClearAllHandles(); foreach (EmotionVector v in Chunk.Data.vectors) { EmotionVectorHandle handle = InstantiateHandle(); handle.SetPositionFromEmotion(v); } }
public void RemoveHandle(EmotionVectorHandle h) { GameObject.Destroy(h.gameObject); handles.Remove(h); }