private void OnAddVector3(object sender, Windows.UI.Xaml.RoutedEventArgs e) { var vector = new Vector3Node(rootController); vector.Translate(new rMind.Types.Vector2(100, 100)); rootController.AddElement(vector); }
internal override AbstractMaterialNode ToConcreteNode() { var node = new Vector3Node(); node.FindInputSlot <Vector1MaterialSlot>(Vector3Node.InputSlotXId).value = value.x; node.FindInputSlot <Vector1MaterialSlot>(Vector3Node.InputSlotYId).value = value.y; node.FindInputSlot <Vector1MaterialSlot>(Vector3Node.InputSlotZId).value = value.z; return(node); }
internal override void BeginPersonnalizeSetup() { mNode = (Vector3Node)node; GameObject prefab = Resources.Load <GameObject>("InputField"); inX = (Instantiate(prefab) as GameObject).GetComponent <InputField>(); inY = (Instantiate(prefab) as GameObject).GetComponent <InputField>(); inZ = (Instantiate(prefab) as GameObject).GetComponent <InputField>(); inX.transform.SetParent(transform, false); inY.transform.SetParent(transform, false); inZ.transform.SetParent(transform, false); inX.onValueChanged.AddListener(OnEnd); inY.onValueChanged.AddListener(OnEnd); inZ.onValueChanged.AddListener(OnEnd); inX.characterLimit = 8; inY.characterLimit = 8; inZ.characterLimit = 8; inX.contentType = InputField.ContentType.DecimalNumber; inY.contentType = InputField.ContentType.DecimalNumber; inZ.contentType = InputField.ContentType.DecimalNumber; inX.textComponent.alignment = TextAnchor.MiddleCenter; inY.textComponent.alignment = TextAnchor.MiddleCenter; inZ.textComponent.alignment = TextAnchor.MiddleCenter; inX.textComponent.horizontalOverflow = HorizontalWrapMode.Overflow; inY.textComponent.horizontalOverflow = HorizontalWrapMode.Overflow; inZ.textComponent.horizontalOverflow = HorizontalWrapMode.Overflow; inY.onEndEdit.AddListener(OnEndY); inX.onEndEdit.AddListener(OnEndX); inZ.onEndEdit.AddListener(OnEnd); ((Text)inX.placeholder).text = "x"; ((Text)inY.placeholder).text = "y"; ((Text)inZ.placeholder).text = "z"; RectTransform rx = inX.GetComponent <RectTransform>(); rx.sizeDelta = new Vector2(30f, 30f); rx.anchoredPosition = new Vector2(0f, 40f); RectTransform ry = inY.GetComponent <RectTransform>(); ry.sizeDelta = new Vector2(30f, 30f); ry.anchoredPosition = new Vector2(0f, 0f); RectTransform rz = inZ.GetComponent <RectTransform>(); rz.sizeDelta = new Vector2(30f, 30f); rz.anchoredPosition = new Vector2(0f, -40f); }
protected override AbstractMaterialNode CreateNode(ShaderGraphBuilder builder, MaterialExpressionConstant3Vector unrealNode) { var node = new Vector3Node() { previewExpanded = false, }; node.FindSlot <Vector1MaterialSlot>(Vector3Node.InputSlotXId).value = unrealNode.Constant.X; node.FindSlot <Vector1MaterialSlot>(Vector3Node.InputSlotYId).value = unrealNode.Constant.Y; node.FindSlot <Vector1MaterialSlot>(Vector3Node.InputSlotZId).value = unrealNode.Constant.Z; return(node); }