Example #1
0
        /// <summary>
        /// Initializes past fly path and adds model scaler to drone.
        /// </summary>
        void Start()
        {
            GameObject flypath = new GameObject("Past Fly Path:" + name);

            m_PastFlyPath = flypath.AddComponent <FlyPath>();
            //gameObject.tag = Constants.TAG_UAV;
            gameObject.AddComponent <Models.ModelScaler>();
            m_PastFlyPathMeshRenderer = m_PastFlyPath.transform.GetChild(0).GetComponent <MeshRenderer>();
            m_PastFlyPathMeshRenderer.material.color = Constants.FLY_PATH_COLOR_PAST;
        }
Example #2
0
        /// <summary>
        /// Creates new predicted fly path from given positions.
        /// </summary>
        /// <param name="positions">positions on fly path</param>
        public void CreateFlyPath(List <Vector3> positions)
        {
            if (m_PredictedFlyPath != null)
            {
                Destroy(m_PredictedFlyPath.gameObject);
            }

            GameObject flypath = new GameObject("Predicted Fly Path:" + name);

            m_PredictedFlyPath = flypath.AddComponent <FlyPath>();
            m_PredictedFlyPath.Init(positions);
            m_PredictedFlyPathMeshRenderer = m_PredictedFlyPath.transform.GetChild(0).GetComponent <MeshRenderer>();
            m_PredictedFlyPathMeshRenderer.material.color = Constants.FLY_PATH_COLOR_FUTURE;
        }
Example #3
0
 public void SetPath(FlyPath path)
 {
     this.path = path;
 }