예제 #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)
 {
 }