Inheritance: MonoBehaviour
Example #1
0
    /// <summary>
    /// Gets the planet VertexNavigation instance.
    /// </summary>
    /// <returns>The planet navigation.</returns>
    public VertexNavigation getPlanetNavigation()
    {
        InterplanetaryObject ipo = this.GetComponent <InterplanetaryObject>();
        Gravity          grav    = ipo.NearestPlanet;
        VertexNavigation vertNav = grav.GetComponent <VertexNavigation>();

        return(vertNav);
//		return (VertexNavigation) this.GetComponent<InterplanetaryObject>().NearestPlanet.GetComponent<VertexNavigation>();
    }
Example #2
0
    /// <summary>
    /// Initialize components
    /// </summary>
    void Start()
    {
        SystemLogger.write("Init Astar");

        // Divide by 2 to get radius not diameter
        this.radius = this.body.GetComponent <Collider>().bounds.size.magnitude *this.multiplier / 2;

        // Get planets navigation
        this.planetVertexNavigation = Player.Instance.getPlanetNavigation();
    }
Example #3
0
    /// <summary>
    /// Initialize information
    /// </summary>
    void Start()
    {
        base.init();

        this.planetVertexNavigation = this.GetComponent <AStar>().planetVertexNavigation;
        base.targetLocation         = Player.Instance.getClosestVertice();
        base.setMovementScript(this.GetComponent <AStar>());
        base.moveTowardsPlayerAtEndOfPath = false;

        baseSpeed = this.moveSpeed;
    }
Example #4
0
    /// <summary>
    /// Initialize information
    /// </summary>
    void Start()
    {
        base.init();

        // grab aStar to get vertex navigation
        this.planetVertexNavigation = this.GetComponent <AStar>().planetVertexNavigation;

        base.targetLocation = Player.Instance.getClosestVertice();
        base.setMovementScript(this.GetComponent <AStar>());
        base.moveTowardsPlayerAtEndOfPath = false;
        this.getNewPlan(Player.Instance.transform.position);
        flyingTowardsPlayer = true;
    }
    /// <summary>
    /// Initialize information
    /// </summary>
    void Start()
    {
        base.init();

        // grab aStar to get vertex navigation
        this.planetVertexNavigation = this.GetComponent<AStar>().planetVertexNavigation;

        base.targetLocation = Player.Instance.getClosestVertice();
        base.setMovementScript(this.GetComponent<AStar>());
        base.moveTowardsPlayerAtEndOfPath = false;
        this.getNewPlan(Player.Instance.transform.position);
        flyingTowardsPlayer = true;
    }
    /// <summary>
    /// Initialize information
    /// </summary>
    void Start()
    {
        base.init();

        // grab aStar to get vertex navigation
        this.planetVertexNavigation = this.GetComponent <AStar>().planetVertexNavigation;

        base.setMovementScript(this.GetComponent <AStar>());
        base.moveTowardsPlayerAtEndOfPath = false;

        // Build plan
        this.updateTargetForMinimumDistance();
        this.getNewPlan(this.targetLocation);
    }
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        if (GUILayout.Button("Bake"))
        {
            Debug.Log("beggining baking");

            foreach (Object targ in targets)
            {
                VertexNavigation vertNav = targ as VertexNavigation;
                vertNav.buildTable();
            }

            Debug.Log("done baking");
        }

        if (GUILayout.Button("Kill Bake"))
        {
            foreach (Object targ in targets)
            {
                VertexNavigation vertNav = targ as VertexNavigation;
                vertNav.killTable();
            }

            Debug.Log("Killed table");
        }

        if (GUILayout.Button("Modify Vertice Height"))
        {
            Debug.Log("Modifying height of vertices");
            foreach (Object targ in targets)
            {
                VertexNavigation vertNav = targ as VertexNavigation;
                vertNav.modifyVerticeHeights();
            }

            Debug.Log("finished modifying height of vertices");
        }

        if (GUILayout.Button("Set Average Vertex Length"))
        {
            foreach (Object targ in targets)
            {
                VertexNavigation vertNav = targ as VertexNavigation;
                vertNav.setAverageVerticeLength();
                Debug.Log("average vertex length: " + vertNav.avgVertexlength);
            }
        }
    }
    /// <summary>
    /// Initialize information
    /// </summary>
    void Start()
    {
        base.init();

        this.planetVertexNavigation = this.GetComponent<AStar>().planetVertexNavigation;
        base.targetLocation = Player.Instance.getClosestVertice();
        base.setMovementScript(this.GetComponent<AStar>());
        base.moveTowardsPlayerAtEndOfPath = false;

        baseSpeed = this.moveSpeed;
    }
Example #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Vertice"/> class.
 /// </summary>
 /// <param name="_key">_key.</param>
 /// <param name="_duplicatePoint">If set to <c>true</c> duplicate point.</param>
 public Vertice(int _key, bool _duplicatePoint, VertexNavigation _vertexNavigation)
 {
     this.key              = _key;
     this.duplicatePoint   = _duplicatePoint;
     this.vertexNavigation = _vertexNavigation;
 }
Example #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Vertice"/> class.
 /// </summary>
 /// <param name="_key">_key.</param>
 /// <param name="_duplicatePoint">If set to <c>true</c> duplicate point.</param>
 public Vertice(int _key, bool _duplicatePoint, VertexNavigation _vertexNavigation)
 {
     this.key = _key;
     this.duplicatePoint = _duplicatePoint;
     this.vertexNavigation = _vertexNavigation;
 }
Example #11
0
    /// <summary>
    /// Initialize components
    /// </summary>
    void Start()
    {
        SystemLogger.write("Init Astar");

        // Divide by 2 to get radius not diameter
        this.radius = this.body.GetComponent<Collider>().bounds.size.magnitude * this.multiplier / 2;

        // Get planets navigation
        this.planetVertexNavigation = Player.Instance.getPlanetNavigation();
    }