public void UpdateInteractable(OCIRoute _route)
        {
            if (_route == null || !_route.listPoint.Contains(this.m_OCIRoutePoint))
            {
                return;
            }
            bool flag = !_route.isPlay;

            this.inputSpeed.interactable = flag;
            ((Selectable)this.dropdownEase).set_interactable(flag);
            this.toggleConnection.interactable = flag;
            ((Selectable)this.toggleLink).set_interactable(flag);
            if (this.m_OCIRoutePoint.connection != OIRoutePointInfo.Connection.Curve || !this.m_OCIRoutePoint.link)
            {
                return;
            }
            int           index         = _route.listPoint.FindIndex((Predicate <OCIRoutePoint>)(p => p == this.m_OCIRoutePoint)) - 1;
            OCIRoutePoint ociRoutePoint = _route.listPoint.SafeGet <OCIRoutePoint>(index);

            if (ociRoutePoint == null || ociRoutePoint.connection != OIRoutePointInfo.Connection.Curve)
            {
                return;
            }
            this.inputSpeed.interactable = false;
            ((Selectable)this.dropdownEase).set_interactable(false);
        }
Beispiel #2
0
        public static void InitAid(OCIRoutePoint _ocirp)
        {
            bool flag = _ocirp.routePointInfo.aidInfo == null;

            if (flag)
            {
                _ocirp.routePointInfo.aidInfo = new OIRoutePointAidInfo(Studio.Studio.GetNewIndex());
            }
            Transform transform = _ocirp.routePoint.objAid.get_transform();

            if (flag)
            {
                _ocirp.routePointInfo.aidInfo.changeAmount.pos = transform.get_localPosition();
            }
            GuideObject _guideObject = Singleton <GuideObjectManager> .Instance.Add(transform, _ocirp.routePointInfo.aidInfo.dicKey);

            _guideObject.enableRot    = false;
            _guideObject.enableScale  = false;
            _guideObject.enableMaluti = false;
            _guideObject.scaleSelect  = 0.1f;
            _guideObject.scaleRot     = 0.05f;
            _guideObject.parentGuide  = _ocirp.guideObject;
            _guideObject.changeAmount.OnChange();
            _guideObject.mode          = GuideObject.Mode.World;
            _guideObject.moveCalc      = GuideMove.MoveCalc.TYPE2;
            _ocirp.pointAidInfo        = new OCIRoutePoint.PointAidInfo(_guideObject, _ocirp.routePointInfo.aidInfo);
            _ocirp.pointAidInfo.active = false;
            _ocirp.routePointInfo.aidInfo.changeAmount.onChangePosAfter += new Action(_ocirp.route.UpdateLine);
        }
Beispiel #3
0
 public void DeletePoint(OCIRoutePoint _routePoint)
 {
     this.Stop(true);
     this.treeNodeObject.RemoveChild(_routePoint.treeNodeObject, true);
     this.listPoint.Remove(_routePoint);
     this.routeInfo.route.Remove(_routePoint.routePointInfo);
     this.UpdateNumber();
     this.UpdateLine();
 }
 public bool Deselect(OCIRoutePoint _ociRoutePoint)
 {
     if (this.m_OCIRoutePoint != _ociRoutePoint)
     {
         return(false);
     }
     this.ociRoutePoint = (OCIRoutePoint)null;
     this.active        = false;
     return(true);
 }
Beispiel #5
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);
        }
Beispiel #6
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);
        }
Beispiel #7
0
        private void OnClickAddPoint()
        {
            if (this.m_OCIRoute == null)
            {
                return;
            }
            OCIRoutePoint ociRoutePoint = this.m_OCIRoute.AddPoint();

            if (!Studio.Studio.optionSystem.autoSelect || ociRoutePoint == null)
            {
                return;
            }
            Singleton <Studio.Studio> .Instance.treeNodeCtrl.SelectSingle(ociRoutePoint.treeNodeObject, true);
        }
Beispiel #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);
        }