Exemple #1
0
        public void Initialize()    // Not sure this is needed because on eval, the entire root object is destroyed.  However if we ever do re-running on a node...
        {
            foreach (var label in LabelViews)
            {
                Object.Destroy(label.gameObject);
            }

            LabelViews.Clear();
        }
Exemple #2
0
        public LabelBehaviour CreateLabel(string text, Vector3 pos, LabelOrientation labelOrientation,
                                          LabelBehaviour labelComponent = null)
        {
            if (labelComponent == null)
            {
                var labelGo = LabelSystemFactory.InstantiateLabel();
                labelComponent = labelGo.GetComponent <LabelBehaviour>();
            }

            labelComponent.Text = text;

            labelComponent.Orientation = labelOrientation;

            labelComponent.transform.SetParent(LabelRoot);
            labelComponent.transform.localPosition = pos;
            labelComponent.transform.localRotation = Quaternion.identity;

            LabelViews.Add(labelComponent);

            return(labelComponent);
        }