Ejemplo n.º 1
0
        private void OnItemDataBinding(object sender, VirtualizingTreeViewItemDataBindingArgs e)
        {
            if (!(e.Item is ObjectCtrl objectCtrl))
            {
                return;
            }
            Text componentInChildren = (Text)e.ItemPresenter.GetComponentInChildren <Text>(true);

            componentInChildren.set_text(objectCtrl.Name);
            OCItem ocItem = objectCtrl as OCItem;

            ((Graphic)componentInChildren).set_color(ocItem == null ? Color.get_white() : (!ocItem.IsOverlapNow ? Color.get_white() : Color.get_red()));
            OCFolder ocFolder = objectCtrl as OCFolder;

            e.HasChildren = ocFolder != null && ocFolder.Child.Count > 0;
            e.CanBeParent = ocFolder != null;
        }
Ejemplo n.º 2
0
        private bool CheckOverlapSize(OCItem _oc)
        {
            bool flag = false;
            IEnumerable <Collider> overlapColliders = this.OverlapColliders;

            if (overlapColliders.IsNullOrEmpty <Collider>())
            {
                Vector3 zero1 = Vector3.get_zero();
                Vector3 zero2 = Vector3.get_zero();
                _oc.GetLocalMinMax(_oc.Position, _oc.Rotation, this.CraftInfo.ObjRoot.get_transform(), ref zero1, ref zero2);
                Bounds bounds1 = (Bounds)null;
                ((Bounds) ref bounds1).SetMinMax(zero1, zero2);
                ref Bounds local1 = ref bounds1;
                ((Bounds) ref local1).set_size(Vector3.op_Subtraction(((Bounds) ref local1).get_size(), OCItem.correctionSize));
                Vector3 zero3 = Vector3.get_zero();
                Vector3 zero4 = Vector3.get_zero();
                this.GetLocalMinMax(this.Position, this.Rotation, this.CraftInfo.ObjRoot.get_transform(), ref zero3, ref zero4);
                Bounds bounds2 = (Bounds)null;
                ((Bounds) ref bounds2).SetMinMax(zero3, zero4);
                ref Bounds local2 = ref bounds2;