コード例 #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);
        }
コード例 #2
0
 public OCIRoutePoint(
     OCIRoute _route,
     OIRoutePointInfo _info,
     GameObject _obj,
     GuideObject _guide,
     TreeNodeObject _treeNode)
 {
     this.route          = _route;
     this.objectInfo     = (ObjectInfo)_info;
     this.objectItem     = _obj;
     this.guideObject    = _guide;
     this.treeNodeObject = _treeNode;
     this.routePoint     = (RoutePointComponent)_obj.GetComponent <RoutePointComponent>();
     this.isParentDelete = false;
     this._line          = (VectorLine)null;
 }
コード例 #3
0
        public override void Load(BinaryReader _reader, Version _version, bool _import, bool _tree = true)
        {
            base.Load(_reader, _version, _import, true);
            this.name = _reader.ReadString();
            ObjectInfoAssist.LoadChild(_reader, _version, this.child, _import);
            int num = _reader.ReadInt32();

            for (int index = 0; index < num; ++index)
            {
                OIRoutePointInfo oiRoutePointInfo = new OIRoutePointInfo(-1);
                oiRoutePointInfo.Load(_reader, _version, false, true);
                this.route.Add(oiRoutePointInfo);
            }
            this.active      = _reader.ReadBoolean();
            this.loop        = _reader.ReadBoolean();
            this.visibleLine = _reader.ReadBoolean();
            this.orient      = (OIRouteInfo.Orient)_reader.ReadInt32();
            this.color       = (Color)JsonUtility.FromJson <Color>(_reader.ReadString());
        }
コード例 #4
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);
        }