private void OnEnable()
 {
     _controllers = null;
     this.UpdateEditor();
     ExtSerializedProperties.SetObjectReferenceValueIfEmpty <ControllerStick>(this.GetPropertie("_controller"), _target.transform);
     this.ApplyModification();
 }
        public void ResetControllerEvents()
        {
            SerializedProperty listToCheck = this.GetPropertie(nameof(_target.ListToCheck));

            PointsOnSplineExtension[] allPoints = _target.Spline.transform.GetComponentsInChildren <PointsOnSplineExtension>();
            ExtSerializedProperties.ApplyArrayToSerializeArray(listToCheck, allPoints);
            this.ApplyModification();
        }
        //protected virtual void OnStartDragging(GameObject current)
        //{
        //    if (_splineController == null)
        //    {
        //        return;
        //    }
        //    if (current != _splineController.gameObject)
        //    {
        //        return;
        //    }
        //    this.UpdateEditor();
        //
        //    _anchorOption = this.GetPropertie("_anchorOnSplineMoved").boolValue;
        //    this.GetPropertie("_anchorOnSplineMoved").boolValue = true;
        //
        //
        //    _positionAtStartLerp = _previousDraggingPosition = _splineController.PathPosition;
        //    //SetSticky(false);
        //    this.ApplyModification();
        //}

        //protected virtual void OnEndDragging(GameObject current)
        //{
        //    if (_splineController == null)
        //    {
        //        return;
        //    }
        //    if (current != _splineController.gameObject)
        //    {
        //        return;
        //    }
        //    this.UpdateEditor();
        //
        //    this.GetPropertie("_anchorOnSplineMoved").boolValue = _anchorOption;
        //
        //
        //    //SetSticky(true);
        //    this.ApplyModification();
        //}

        public void ConstructSpline(SplineBase spline)
        {
            this.UpdateEditor();
            if (spline != null)
            {
                ExtSerializedProperties.SetObjectReferenceValueIfEmpty <SplineBase>(this.GetPropertie("_spline"), spline.transform);
            }
            ExtSerializedProperties.SetObjectReferenceValueIfEmpty <Transform>(this.GetPropertie("_toMove"), _splineController.transform);
            this.ApplyModification();
        }
Пример #4
0
 public void ConstructSticker(ControllerStick sticker)
 {
     this.UpdateEditor();
     if (sticker != null)
     {
         ExtSerializedProperties.SetObjectReferenceValueIfEmpty <ControllerStick>(this.GetPropertie("_targetStick"), sticker.transform);
         ExtSerializedProperties.SetObjectReferenceValueIfEmpty <SplineBase>(this.GetPropertie("_spline"), sticker.SplineBase.transform);
     }
     ExtSerializedProperties.SetObjectReferenceValueIfEmpty <Transform>(this.GetPropertie("_toMove"), _target.transform);
     this.ApplyModification();
 }
        protected virtual void OnEnable()
        {
            _waypointList = null;

            this.UpdateEditor();
            ExtSerializedProperties.SetObjectReferenceValueIfEmpty <SplineBase>(this.GetPropertie("_spline"), _target.transform);
            this.ApplyModification();

            _previousPositionUnit = _target.PositionUnits;

            if (_target.GetComponent <SplineBase>() == null)
            {
                Tools.hidden = true;
            }
        }
 protected virtual void OnEnable()
 {
     if (target is ControllerStick)
     {
         _splineController = (ControllerStick)target;
         this.UpdateEditor();
         ExtSerializedProperties.SetObjectReferenceValueIfEmpty <SplineBase>(this.GetPropertie("_spline"), _splineController.transform);
         ExtSerializedProperties.SetObjectReferenceValueIfEmpty <Transform>(this.GetPropertie("_toMove"), _splineController.transform);
         this.ApplyModification();
     }
     if (_splineController)
     {
         _positionUnits = _splineController.PositionUnits;
     }
 }
Пример #7
0
 /// <summary>
 /// when stop dragging, change order of lists
 /// abort if list is different than previously when drag first occure
 /// </summary>
 /// <param name="listToDisplay"></param>
 /// <param name="pathLinked"></param>
 /// <param name="initialListToDisplay"></param>
 public void StopDragging(SerializedProperty listToDisplay, SerializedProperty pathLinked, SerializedProperty sceneLinked, List <Object> initialListToDisplay)
 {
     if (!ExtSerializedProperties.AreListObjectHaveSameContent(listToDisplay, initialListToDisplay))
     {
         AbortDragging();
         return;
     }
     IsDragging    = false;
     InitialOffset = 0;
     listToDisplay.MoveArrayElement(CurrentIndexSelected, RealDropIndex);
     pathLinked?.MoveArrayElement(CurrentIndexSelected, RealDropIndex);
     sceneLinked?.MoveArrayElement(CurrentIndexSelected, RealDropIndex);
     CurrentIndexSelected             = -1;
     CurrentIndexShouldPointEmptyCell = -1;
 }
Пример #8
0
        private void OnEnable()
        {
            if (Application.isPlaying)
            {
                return;
            }

            this.UpdateEditor();
            ExtSerializedProperties.SetObjectReferenceValueIfEmpty <Transform>(this.GetPropertie("_toMove"), _target.transform);
            if (_target.TargetStick != null && _target.TargetStick.SplineBase != null)
            {
                ExtSerializedProperties.SetObjectReferenceValueIfEmpty <SplineBase>(this.GetPropertie("_spline"), _target.TargetStick.SplineBase.transform);
            }
            this.ApplyModification();
        }
 private bool AttemptToAutoFillPointsOnSplines()
 {
     if (_target.ListToCheck.Length != 0)
     {
         return(false);
     }
     this.UpdateEditor();
     if (_target.Spline != null)
     {
         PointsOnSplineExtension[] allPoints = _target.Spline.transform.GetComponentsInChildren <PointsOnSplineExtension>();
         if (allPoints.Length == 0)
         {
             allPoints = GameObject.FindObjectsOfType <PointsOnSplineExtension>();
         }
         ExtSerializedProperties.ApplyArrayToSerializeArray(_controllers.serializedProperty, allPoints);
         this.ApplyModification();
     }
     return(true);
 }
 public void ConstructSplineZone(SplineBase spline)
 {
     this.UpdateEditor();
     ExtSerializedProperties.SetObjectReferenceValueIfEmpty <SplineBase>(this.GetPropertie("_triangle"), spline.transform);
     this.ApplyModification();
 }
Пример #11
0
 protected virtual void OnEnable()
 {
     this.UpdateEditor();
     ExtSerializedProperties.SetObjectReferenceValueIfEmpty <PointsOnSplineExtension>(this.GetPropertie("_points"), _target.transform);
     this.ApplyModification();
 }