Exemple #1
0
 private void ClearChildern()
 {
     this.Childern = new ObservableCollection <DirectoryItemViewModel>();
     if (this.Type != DirectoryItemType.File)
     {
         Childern.Add(null);
     }
 }
        protected virtual void InitChildern()
        {
            Childern = MoeTools.Inspector.GetChildern(SerializedObject);

            if (!drawScriptField)
            {
                Childern.RemoveAt(0);
            }
        }
Exemple #3
0
 public void AddChild(bool setParent, params TreeNode[] nodes)
 {
     foreach (TreeNode node in nodes)
     {
         Childern.Add(node, node.Type);
         if (setParent)
         {
             node.Parent = this;
         }
     }
 }
Exemple #4
0
 public void sortChildren()
 {
     if (!IsFile && Childern.Count > 0)
     {
         foreach (FileNode child in Childern)
         {
             child.sortChildren();
         }
         Childern.Sort((x, y) => x.IsFile == y.IsFile ? StringComparer.CurrentCultureIgnoreCase.Compare(x.Name, y.Name) : x.IsFile ? 1 : -1);
     }
 }
Exemple #5
0
        protected virtual void UpdateChildern()
        {
            Childern.Clear();

            for (int i = 0; i < transform.childCount; i++)
            {
                if (transform.GetChild(i).gameObject.activeInHierarchy&& !transform.GetChild(i).gameObject.GetComponent <LayoutSeperatorElement>())
                {
                    Childern.Add(transform.GetChild(i));
                }
            }
        }
        void DivideTo(params Face2D[] faces)
        {
            if (faces.Length != 3)
            {
                throw new System.Exception("The Sub face array must has three childern!");
            }

            if (Childern == null)
            {
                Childern = new List <Face2D>(faces);
            }
            else
            {
                Childern.Clear();
            }

            Childern.AddRange(faces);

            Childern.ForEach(c => { c.Parents = this; c.AddRigidbodyAndSpring(Scale * 0.5f); });
        }
        void HandleOnUnite()
        {
            //List<Point2D> allPoint = ActualPoints;

            Edge2D[] centerEdges = CenterPoint.Edges.ToArray();

            //Debug.Log("Center Edges Count : " + centerEdges.Length);

            for (int i = 0; i < centerEdges.Length; i++)
            {
                centerEdges[i].DestorySelf();
            }

            CenterPoint.DestroySelf();
            CenterPoint = null;

            foreach (var e in BasicEdges)
            {
                e.DivisionCount--;
                if (e.DivisionCount == 0)
                {
                    Edge2D[] middleEdges = e.MiddlePoint.Edges.ToArray();
                    for (int i = 0; i < middleEdges.Length; i++)
                    {
                        middleEdges[i].DestorySelf();
                    }
                    e.OnUnite();
                }
            }

            foreach (var child in Childern)
            {
                Shape.RemoveFace(child);
            }

            Shape.AddFace(this);

            Childern.Clear();
        }