Quantcast
Channel: Questions in topic: "tree"
Viewing all articles
Browse latest Browse all 513

UnityEngine.Vector2 to float

$
0
0
I am trying to create a script attached to a button that will simulate a treeview in ui using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class Heights : MonoBehaviour { public RawImage right; public RawImage down; public Vector2 position = new Vector2(0.5f, 0.5f); public float GetHeight() { Vector2 height = gameObject.transform.position; if (right.gameObject.activeInHierarchy.Equals(true)) // if the arrow is facing right return height; else { foreach (Transform child in transform) height += child.GetHeight(); return height; } } }

Viewing all articles
Browse latest Browse all 513

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>