private static UIBase ParseAttributeForTextFieldWidthUnit(IElement element, int[] layout) { int[] elmLayout = GetLayout(element.Children[0].Style, layout); var tmp = new UIEdit() { x = elmLayout[0], y = elmLayout[1], width = elmLayout[2], height = elmLayout[3], }; if (element.Children[0].TextContent[0] != '~') { // Is readonly attribute tmp.Text = element.Children[0].TextContent; tmp.ReadOnly = true; } else { tmp.Text = element.Children[0].TextContent.Substring(1); } tmp.WidthLabel = element.Children[0].GetWidth(); tmp.NestedName = element.Children[1].GetAttribute("nested-name"); tmp.Value = element.Children[1].GetAttribute("value"); tmp.ValueType = element.Children[1].GetAttribute("type"); foreach (var option in element.Children[2].Children) { string value = option.GetAttribute("selected"); if (value == "selected") { tmp.Unit = option.TextContent; } } return(tmp); }
public ViewCRUDClientControl() { InitializeComponent(); UICreate.CollapsedCreate(); UIEdit.CollapsedEdit(); UIRemove.CollapsedRemove(); }
// Use this for initialization void Awake() { Input.backButtonLeavesApp = true; self = this; colorMap[0] = Color.green; colorMap[1] = Color.blue; colorMap[2] = new Color(0f, 1f, 1f); colorMap[3] = Color.black; colorMap[4] = Color.red; colorMap[5] = new Color(1f, 0f, 1f); colorMap[6] = new Color(1f, 1f, 0f); Mesh tileMesh = TilePrefab.GetComponent <MeshFilter>().sharedMesh; baseMainVerts = tileMesh.vertices; convertToSides(tileMesh, baseMainVerts, ref sideVerts); tileMesh.vertices = baseMainVerts; sideView = false; inventory = new Inventory(GameObject.FindGameObjectWithTag("inventory"), false); equipment = new Inventory(GameObject.FindGameObjectWithTag("equipS"), true); myCam = GameObject.FindGameObjectWithTag("Cam2").GetComponent <Camera> (); mainCam = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera> (); soundUI = myCam.transform.GetChild(1).GetComponent <AudioSource> (); soundEquip = myCam.transform.GetChild(2).GetComponent <AudioSource> (); playerLocation = GameObject.FindGameObjectWithTag("Player").GetComponent <Transform> (); //playerAnim = playerLocation.GetComponent<Animator> (); //playerFollowL = GameObject.FindGameObjectWithTag ("PlayerFollow").GetComponent<Transform> (); UIInventory.SetActive(false); UINormal.SetActive(false); UIEdit.SetActive(false); UIMove.SetActive(false); UIChat.SetActive(false); UIStats.SetActive(false); UIHaS.SetActive(false); UICompass.SetActive(false); UIOptions.SetActive(false); chCam = chatCam.GetComponent <Camera> (); chCam.enabled = false; //chatCam.SetActive (false); selBox = GameObject.FindGameObjectWithTag("selectBox"); selCirc = GameObject.FindGameObjectWithTag("selectCircle"); selBox.SetActive(false); selCirc.SetActive(false); selectBox = selBox; foreach (EnemyType type in Enum.GetValues(EnemyType.archer.GetType())) { GameObject prefab = Resources.Load <GameObject>("Prefabs/enemy/" + type.ToString()); enemyPrefabs.Add(type, prefab); } }
///////////////////////////////////////// protected override void OnRenderEdit(UIEdit control, CanvasRenderer renderer) { base.OnRenderEdit(control, renderer); }
public void SendUIEdit(IUIProject project, object modelObject, string propStr, object newValue) { UIEdit op = new UIEdit(); op.ModelObject = modelObject; op.PropertyStr = propStr; op.NewValue = newValue; project.Submit(op); }