Beispiel #1
0
    public void GoToCashMachine()
    {
        Debug.Log("Going to cash machine. cash = " + this.cash);

        GameObject cashMachine = this.locationManager.GetCashMachines()[0];

        if (cashMachine == null)
        {
            Debug.LogError("Got a null cash machine from Location Manager.");
            return;
        }

        this.targetLocation = (AccessibleLocation) cashMachine.GetComponent("CashMachineLocation");

        this.GoToLocation(this.targetLocation);
    }
Beispiel #2
0
    public void GoToRandomShop()
    {
        Debug.Log("Going to random shop. cash = " + this.cash);

        GameObject shop = this.locationManager.GetRandomShop();

        if (shop == null)
        {
            Debug.LogError("Got a null shop from Location Manager.");
            return;
        }

        this.targetLocation = (AccessibleLocation) shop.GetComponent("ShopLocation");

        this.GoToLocation(this.targetLocation);
    }
Beispiel #3
0
    private void OnLocationReached()
    {
        this.targetLocation.RunHumanInteraction(this);

        this.targetLocation = null;
        this.movingToLocation = false;
    }
Beispiel #4
0
    private void GoToLocation(AccessibleLocation location)
    {
        if (location == null)
        {
            Debug.LogError("Attempted to move to a null target location.");
            return;
        }

        if (location.accessPoint == null)
        {
            Debug.LogError("Attempted to move to a target location with a null access point.");
            return;
        }

        this.aStarAI.MoveTo(location.accessPoint.transform.position);

        this.movingToLocation = true;
    }