Exemplo n.º 1
0
        private void applyPart(int slotIndex, int partIndex, DceModel.Part newPart)
        {
            DceViewDistinctChild dceViewDistinctChild = children[slotIndex, partIndex];

            if (dceViewDistinctChild == null && newPart != null)
            {
                string     text       = "DceViewDistinct";
                GameObject gameObject = new GameObject(text);
                gameObject.transform.SetParent(base.transform, worldPositionStays: false);
                gameObject.layer = base.gameObject.layer;
                gameObject.SetActive(value: false);
                dceViewDistinctChild           = gameObject.AddComponent <DceViewDistinctChild>();
                dceViewDistinctChild.SlotIndex = slotIndex;
                dceViewDistinctChild.PartIndex = partIndex;
                dceViewDistinctChild.Model     = Model;
                dceViewDistinctChild.Rig       = rig;
                gameObject.SetActive(value: true);
                children[slotIndex, partIndex] = dceViewDistinctChild;
                if (this.OnChildAdded != null)
                {
                    this.OnChildAdded(dceViewDistinctChild);
                }
            }
            boundsIsDirty = true;
            if (dceViewDistinctChild != null)
            {
                dceViewDistinctChild.Apply(newPart);
                if (dceViewDistinctChild.IsBusy && !base.IsBusy)
                {
                    startWork();
                }
            }
        }
Exemplo n.º 2
0
        public void Update()
        {
            bool flag  = false;
            bool flag2 = true;

            for (int i = 0; i < children.GetLength(0); i++)
            {
                for (int j = 0; j < children.GetLength(1); j++)
                {
                    DceViewDistinctChild dceViewDistinctChild = children[i, j];
                    if (dceViewDistinctChild != null)
                    {
                        flag  |= dceViewDistinctChild.IsBusy;
                        flag2 &= dceViewDistinctChild.IsReady;
                    }
                }
            }
            if (flag && !base.IsBusy)
            {
                startWork();
            }
            else if (!flag && base.IsBusy)
            {
                stopWork();
            }
            else if (flag2 && !base.IsReady)
            {
                startWork();
                stopWork();
            }
        }
Exemplo n.º 3
0
 public override Bounds GetBounds()
 {
     if (boundsIsDirty)
     {
         Debug.Log("CARL: UPDATING");
         cachedBounds = new Bounds(base.transform.position, Vector3.zero);
         for (int i = 0; i < children.GetLength(0); i++)
         {
             for (int j = 0; j < children.GetLength(1); j++)
             {
                 DceViewDistinctChild dceViewDistinctChild = children[i, j];
                 if (dceViewDistinctChild != null)
                 {
                     cachedBounds.Encapsulate(dceViewDistinctChild.Renderer.bounds);
                 }
             }
         }
         boundsIsDirty = false;
     }
     return(cachedBounds);
 }