Exemplo n.º 1
0
        public static OCIRoutePoint AddPoint(OCIRoute _ocir)
        {
            OIRoutePointInfo _rpInfo = new OIRoutePointInfo(Studio.Studio.GetNewIndex());

            _ocir.routeInfo.route.Add(_rpInfo);
            OCIRoutePoint ociRoutePoint = AddObjectRoute.LoadPoint(_ocir, _rpInfo, 1);

            _ocir.visibleLine = _ocir.visibleLine;
            Singleton <Studio.Studio> .Instance.treeNodeCtrl.RefreshHierachy();

            return(ociRoutePoint);
        }
Exemplo n.º 2
0
        public static OCIRoute Load(
            OIRouteInfo _info,
            ObjectCtrlInfo _parent,
            TreeNodeObject _parentNode,
            bool _addInfo,
            int _initialPosition)
        {
            OCIRoute _ocir = new OCIRoute();

            _ocir.objectInfo = (ObjectInfo)_info;
            GameObject gameObject = CommonLib.LoadAsset <GameObject>("studio/base/00.unity3d", "p_Route", true, string.Empty);

            if (Object.op_Equality((Object)gameObject, (Object)null))
            {
                Studio.Studio.DeleteIndex(_info.dicKey);
                return((OCIRoute)null);
            }
            gameObject.get_transform().SetParent(Singleton <Scene> .Instance.commonSpace.get_transform());
            _ocir.objectItem = gameObject;
            GuideObject guideObject = Singleton <GuideObjectManager> .Instance.Add(gameObject.get_transform(), _info.dicKey);

            guideObject.isActive    = false;
            guideObject.scaleSelect = 0.1f;
            guideObject.scaleRot    = 0.05f;
            guideObject.enableScale = false;
            guideObject.SetVisibleCenter(true);
            _ocir.guideObject = guideObject;
            _ocir.childRoot   = gameObject.get_transform().GetChild(0);
            if (_addInfo)
            {
                Studio.Studio.AddInfo((ObjectInfo)_info, (ObjectCtrlInfo)_ocir);
            }
            else
            {
                Studio.Studio.AddObjectCtrlInfo((ObjectCtrlInfo)_ocir);
            }
            TreeNodeObject _parent1 = !Object.op_Inequality((Object)_parentNode, (Object)null) ? (_parent == null ? (TreeNodeObject)null : _parent.treeNodeObject) : _parentNode;
            TreeNodeObject _parent2 = Studio.Studio.AddNode(_info.name, _parent1);

            _parent2.treeState                     = _info.treeState;
            _parent2.enableVisible                 = true;
            _parent2.enableChangeParent            = false;
            _parent2.visible                       = _info.visible;
            _parent2.colorSelect                   = _parent2.baseColor;
            _parent2.onVisible                    += new TreeNodeObject.OnVisibleFunc(((ObjectCtrlInfo)_ocir).OnVisible);
            _parent2.onDelete                     += new Action(_ocir.OnDeleteNode);
            _parent2.checkChild                   += new TreeNodeObject.CheckFunc(_ocir.CheckParentLoop);
            _parent2.checkParent                  += new TreeNodeObject.CheckFunc(_ocir.CheckParentLoop);
            guideObject.guideSelect.treeNodeObject = _parent2;
            _ocir.treeNodeObject                   = _parent2;
            _ocir.routeComponent                   = (RouteComponent)gameObject.GetComponent <RouteComponent>();
            TreeNodeObject treeNodeObject = Studio.Studio.AddNode("子接続先", _parent2);

            treeNodeObject.enableChangeParent = false;
            treeNodeObject.enableDelete       = false;
            treeNodeObject.enableCopy         = false;
            treeNodeObject.baseColor          = Utility.ConvertColor(204, 128, 164);
            treeNodeObject.colorSelect        = treeNodeObject.baseColor;
            _parent2.childRoot  = treeNodeObject;
            _ocir.childNodeRoot = treeNodeObject;
            if (_info.route.IsNullOrEmpty <OIRoutePointInfo>())
            {
                _ocir.routeInfo.route.Add(new OIRoutePointInfo(Studio.Studio.GetNewIndex()));
            }
            foreach (OIRoutePointInfo _rpInfo in _info.route)
            {
                AddObjectRoute.LoadPoint(_ocir, _rpInfo, -1);
            }
            Singleton <Studio.Studio> .Instance.treeNodeCtrl.RefreshHierachy();

            if (_initialPosition == 1)
            {
                _info.changeAmount.pos = Singleton <Studio.Studio> .Instance.cameraCtrl.targetPos;
            }
            _info.changeAmount.OnChange();
            Studio.Studio.AddCtrlInfo((ObjectCtrlInfo)_ocir);
            _parent?.OnLoadAttach(!Object.op_Inequality((Object)_parentNode, (Object)null) ? _parent.treeNodeObject : _parentNode, (ObjectCtrlInfo)_ocir);
            _info.changeAmount.onChangePos += new Action(_ocir.UpdateLine);
            _info.changeAmount.onChangeRot += new Action(_ocir.UpdateLine);
            _ocir.ForceUpdateLine();
            _ocir.visibleLine = _ocir.visibleLine;
            if (_ocir.isPlay)
            {
                _ocir.Play();
            }
            else
            {
                _ocir.Stop(true);
            }
            return(_ocir);
        }