//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * New Method: Create Bezier Curves Path //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ protected void CreateBezierCurvesPath() { // Create Nodes List <Vector3> lPointsList = new List <Vector3>(); Vector3 vCurrentPathPosition = GetWorldPosition(); for (int i = 0; i < m_PathPoints.Length; ++i) { vCurrentPathPosition += GetDirectionPathPoint(m_PathPoints[i]) * m_fDirectionMovementOffset; lPointsList.Add(vCurrentPathPosition); } int iProperSmothnessRating = (101 - ((m_iSmoothnessRating > 0 && m_iSmoothnessRating < 101) ? m_iSmoothnessRating : 50)); float fSmoothnessPercentile = ((float)iProperSmothnessRating * 0.01f); // Smoothness Percent lPointsList.Insert(0, GetWorldPosition()); // First Point is SelfPosition List <Vector3> lBezierPointsList = GetBezierPoints(fSmoothnessPercentile, lPointsList); // Get Bezier Curving m_FlightPath = new ArrayElementTracker <Vector3>(lBezierPointsList.Count); int iCurrentArrayElement = 0; foreach (Vector3 Node in lBezierPointsList) { m_FlightPath[iCurrentArrayElement] = Node; iCurrentArrayElement += 1; } }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * New Method: Set Text //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ public void SetText(string Text, SpokesPersonState Speaker = SpokesPersonState.GENERAL, float ScrollSpeed = 20.0f) { if (Text != "") { m_ScrollInfo.UpdateText = true; m_ScrollInfo.Scroll = true; m_ScrollInfo.Dir = ScrollDirection.UP; //Text = ReplaceRGBCommandsWithHex(Text); m_aTextArray = new ArrayElementTracker <string>(ReplaceENDL(Text)); m_eSpeaker = Speaker; m_fScrollSpeed = ScrollSpeed; if (m_SoundFiles.FlyInSource != null && m_SoundFiles.FlyInSource.Length > 0) { m_SoundFiles.FlyInSource[Random.Range(0, m_SoundFiles.FlyInSource.Length)].Play(); } } ResetTextDisplay(); }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * New Method: Create Straight Path //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ protected void CreateStraightPath() { // Create Nodes List <Vector3> lPointsList = new List <Vector3>(); Vector3 vCurrentPathPosition = GetWorldPosition(); for (int i = 0; i < m_PathPoints.Length; ++i) { vCurrentPathPosition += GetDirectionPathPoint(m_PathPoints[i]) * m_fDirectionMovementOffset; lPointsList.Add(vCurrentPathPosition); } m_FlightPath = new ArrayElementTracker <Vector3>(lPointsList.Count); int iCurrentArrayElement = 0; foreach (Vector3 Node in lPointsList) { m_FlightPath[iCurrentArrayElement] = Node; iCurrentArrayElement += 1; } }