summaryrefslogtreecommitdiff
path: root/Other/NodeEditorExamples/Assets/xNode-examples/Examples/RuntimeMathGraph/Scripts/RuntimeNodes/UGUIDisplayValue.cs
blob: da5e4c2086704ab3cdfa49e7fb29cc19641fcb92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using XNode.Examples.MathNodes;

namespace XNode.Examples.RuntimeMathNodes {
	public class UGUIDisplayValue : UGUIMathBaseNode {
		public Text label;

		void Update() {
			DisplayValue displayValue = node as DisplayValue;
			object obj = displayValue.GetInputValue<object>("input");
			if (obj != null) label.text = obj.ToString();
			else label.text = "n/a";
		}
	}
}