Пример #1
0
        public OCIRoutePoint AddPoint()
        {
            if (Studio.Studio.optionSystem.routePointLimit && this.routeInfo.route.Count > 10)
            {
                return((OCIRoutePoint)null);
            }
            OCIRoutePoint ociRoutePoint = AddObjectRoute.AddPoint(this);

            this.UpdateLine();
            return(ociRoutePoint);
        }
Пример #2
0
        public static OCIRoute Load(
            OIRouteInfo _info,
            ObjectCtrlInfo _parent,
            TreeNodeObject _parentNode)
        {
            ChangeAmount _source  = _info.changeAmount.Clone();
            OCIRoute     ociRoute = AddObjectRoute.Load(_info, _parent, _parentNode, false, -1);

            _info.changeAmount.Copy(_source, true, true, true);
            AddObjectAssist.LoadChild(_info.child, (ObjectCtrlInfo)ociRoute, (TreeNodeObject)null);
            return(ociRoute);
        }
Пример #3
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);
        }
Пример #4
0
        public void AddRoute()
        {
            OCIRoute ociRoute = AddObjectRoute.Add();

            if (this._routeControl.visible)
            {
                this._routeControl.Init();
            }
            Singleton <UndoRedoManager> .Instance.Clear();

            if (!Studio.Studio.optionSystem.autoSelect || ociRoute == null)
            {
                return;
            }
            this.m_TreeNodeCtrl.SelectSingle(ociRoute.treeNodeObject, true);
        }
Пример #5
0
        public static void LoadChild(
            ObjectInfo _child,
            ObjectCtrlInfo _parent     = null,
            TreeNodeObject _parentNode = null)
        {
            switch (_child.kind)
            {
            case 0:
                OICharInfo _info = _child as OICharInfo;
                if (_info.sex == 1)
                {
                    AddObjectFemale.Load(_info, _parent, _parentNode);
                    break;
                }
                AddObjectMale.Load(_info, _parent, _parentNode);
                break;

            case 1:
                AddObjectItem.Load(_child as OIItemInfo, _parent, _parentNode);
                break;

            case 2:
                AddObjectLight.Load(_child as OILightInfo, _parent, _parentNode);
                break;

            case 3:
                AddObjectFolder.Load(_child as OIFolderInfo, _parent, _parentNode);
                break;

            case 4:
                AddObjectRoute.Load(_child as OIRouteInfo, _parent, _parentNode);
                break;

            case 5:
                AddObjectCamera.Load(_child as OICameraInfo, _parent, _parentNode);
                break;
            }
        }
Пример #6
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);
        }
Пример #7
0
 public static OCIRoute Add()
 {
     return(AddObjectRoute.Load(new OIRouteInfo(Studio.Studio.GetNewIndex()), (ObjectCtrlInfo)null, (TreeNodeObject)null, true, Studio.Studio.optionSystem.initialPosition));
 }
Пример #8
0
        public static OCIRoutePoint LoadPoint(
            OCIRoute _ocir,
            OIRoutePointInfo _rpInfo,
            int _initialPosition)
        {
            int        index      = !_ocir.listPoint.IsNullOrEmpty <OCIRoutePoint>() ? _ocir.listPoint.Count - 1 : -1;
            GameObject gameObject = CommonLib.LoadAsset <GameObject>("studio/base/00.unity3d", "p_RoutePoint", true, string.Empty);

            if (Object.op_Equality((Object)gameObject, (Object)null))
            {
                Studio.Studio.DeleteIndex(_rpInfo.dicKey);
                return((OCIRoutePoint)null);
            }
            gameObject.get_transform().SetParent(_ocir.objectItem.get_transform());
            GuideObject _guide = Singleton <GuideObjectManager> .Instance.Add(gameObject.get_transform(), _rpInfo.dicKey);

            _guide.isActive    = false;
            _guide.scaleSelect = 0.1f;
            _guide.scaleRot    = 0.05f;
            _guide.enablePos   = index != -1;
            _guide.enableRot   = index == -1;
            _guide.enableScale = false;
            _guide.mode        = GuideObject.Mode.World;
            _guide.moveCalc    = GuideMove.MoveCalc.TYPE2;
            TreeNodeObject childRoot = _ocir.treeNodeObject.childRoot;

            _ocir.treeNodeObject.childRoot = (TreeNodeObject)null;
            TreeNodeObject _treeNode = Studio.Studio.AddNode(_rpInfo.name, _ocir.treeNodeObject);

            _treeNode.treeState               = _rpInfo.treeState;
            _treeNode.enableChangeParent      = false;
            _treeNode.enableDelete            = index != -1;
            _treeNode.enableAddChild          = false;
            _treeNode.enableCopy              = false;
            _treeNode.enableVisible           = false;
            _guide.guideSelect.treeNodeObject = _treeNode;
            _ocir.treeNodeObject.childRoot    = childRoot;
            OCIRoutePoint _ocirp = new OCIRoutePoint(_ocir, _rpInfo, gameObject, _guide, _treeNode);

            _ocir.listPoint.Add(_ocirp);
            _ocir.UpdateNumber();
            _treeNode.onVisible += new TreeNodeObject.OnVisibleFunc(((ObjectCtrlInfo)_ocirp).OnVisible);
            _guide.isActiveFunc += new GuideObject.IsActiveFunc(((ObjectCtrlInfo)_ocirp).OnSelect);
            Studio.Studio.AddCtrlInfo((ObjectCtrlInfo)_ocirp);
            AddObjectRoute.InitAid(_ocirp);
            if (_initialPosition == 1)
            {
                if (index == -1)
                {
                    _rpInfo.changeAmount.pos = _ocir.objectInfo.changeAmount.pos;
                }
                else
                {
                    OCIRoutePoint ociRoutePoint = _ocir.listPoint[index];
                    _rpInfo.changeAmount.pos = _ocir.objectItem.get_transform().InverseTransformPoint(ociRoutePoint.position);
                }
            }
            _rpInfo.changeAmount.OnChange();
            _rpInfo.changeAmount.onChangePosAfter += new Action(_ocir.UpdateLine);
            _rpInfo.changeAmount.onChangeRot      += new Action(_ocir.UpdateLine);
            _ocirp.connection = _ocirp.connection;
            return(_ocirp);
        }