protected override void _DoEditorInitialize()
        {
            base._DoEditorInitialize();

            if (PatrouillerPath == null)
            {
                PatrouillerPath = gameObject.GetComponent <BezierCurve.BezierCurve>();
                if (PatrouillerPath == null)
                {
                    PatrouillerPath = gameObject.AddComponent <BezierCurve.BezierCurve>();
                }
            }
        }
Exemple #2
0
        protected override void _DoEditorInitialize()
        {
            base._DoEditorInitialize();

            _FragmentPath = new GameObject("Fragment Path").AddComponent <BezierCurve.BezierCurve>();
            _FragmentPath.gameObject.hideFlags = HideFlags.DontSave;
            _FragmentPath.transform.SetParent(transform, false);
            _FragmentPath.SetCloseCurve(_FragmentPathData.Close);
            _FragmentPath.SetResolution(_FragmentPathData.Resolution);
            for (int iPoint = 0; iPoint < _FragmentPathData.Points.Length; iPoint++)
            {
                _FragmentPath.AddPoint_LocalSpace(_FragmentPathData.Points[iPoint].HandleStyle
                                                  , _FragmentPathData.Points[iPoint].PointPosition
                                                  , _FragmentPathData.Points[iPoint].Handle1Position
                                                  , _FragmentPathData.Points[iPoint].Handle2Position);
            }
        }