Ejemplo n.º 1
0
 internal void DeleteLabel(LabelAction labelAction)
 {
     if (this.labels.ContainsKey(labelAction.name))
     {
         LabelAction label      = this.labels[labelAction.name];
         int         labelIndex = this.labelActions.IndexOf(label);
         if (labelIndex < 0)
         {
             Debug.Log("Cannot find toggle index for label: " + label.name);
         }
         else
         {
             this.labels.Remove(label.name);
             this.labelActions.Remove(label);
             label.GetComponent <LabelAction>().selectLabels = null;
             label.transform.SetParent(null);
             Destroy(label);
             for (int i = 0; i < this.labelActions.Count; i++)
             {
                 PositionLabel(i, this.labelActions[i]);
             }
         }
     }
     else
     {
         Debug.Log("Could not find label to delete: " + labelAction.name);
     }
 }
Ejemplo n.º 2
0
        private void PositionLabel(int labelIndex, LabelAction labelAction)
        {
            RectTransform toggleTransform = labelAction.GetComponent <RectTransform>();

            toggleTransform.localEulerAngles = Vector3.zero;
            toggleTransform.localScale       = Vector3.one;
            toggleTransform.localPosition    = new Vector3(this.labelX, this.labelYTop - this.labelYGap * labelIndex, 0);
        }