Ejemplo n.º 1
0
 override protected void DoOnStart()
 {
     base.DoOnStart();
     //if no target specified, it is the player's ship
     if (target == null)
     {
         PlayerShipMove psm = FindObjectOfType <PlayerShipMove>();
         if (psm != null)
         {
             target = FindObjectOfType <PlayerShipMove>().transform;
         }
     }
 }
Ejemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        PlayerShipMove psm = player.GetComponent <PlayerShipMove>();

        if (hangarOpen && !collectingOre && psm.moveSpeed < psm.maxSpeed)
        {
            Mathf.Clamp(player.GetComponent <PlayerShipMove>().moveSpeed += 0.005f, 0f, 1.5f);
        }

        if (collectedOre >= 5 && collectingOre)
        {
            player.GetComponent <PlayerShipMove>().SetActiveWaypoint(GameObject.Find("hangar/waypoint_hangar"));
            collectingOre = false;
        }
    }
Ejemplo n.º 3
0
    void Awake()
    {
        Me = this;

        state = ShipStates.init;
    }