Пример #1
0
        private void Init()
        {
            if (m_bInit)
            {
                return;
            }
            m_bInit          = true;
            m_tMineTransform = transform;

            m_tUnuseContainer = new GameObject("UnUse").GetComponent <Transform>();
            m_tUnuseContainer.SetParent(m_tMineTransform);

            m_SplineComponent = GetComponent <SplineComponent>();
            m_fOldLength      = m_SplineComponent.GetSplineLength();

            m_listUnuseContainer = new List <Transform>();
            m_listUseContainer   = new List <Transform>();

            if (MeshPrefab == null)
            {
                MeshPrefab = GameObject.CreatePrimitive(PrimitiveType.Cube);
                BoxCollider collider = MeshPrefab.GetComponent <BoxCollider>();
                DestroyImmediate(collider);
            }
        }
Пример #2
0
        void OnSceneGUI()
        {
            if (!SelectSpline.DrawDebug || !SelectSpline.IsInit)
            {
                return;
            }

            SelectSpline    = target as SplineComponent;
            handleTransform = SelectSpline.transform;
            handleRotation  = Tools.pivotRotation == PivotRotation.Local ?
                              handleTransform.rotation : Quaternion.identity;


            // Vector3 p0 = ShowPoint(0);

            for (int i = 0; i < SelectSpline.GetNumberOfSplinePoints(); i++)
            {
                ShowTangentPoint(i);
                ShowPoint(i);
            }
        }
Пример #3
0
 static void DrawGizmos(SplineComponent _spline)
 {
 }