Beispiel #1
0
    protected virtual void AttemptPillage()
    {
        float treasureDistance = Vector2.Distance(transform.position, treasure.transform.position);

        if (treasureDistance < pillageRadius && treasureScript.wealth > 0)
        {
            Instantiate(pillageSound);
            treasureScript.GetPillaged(pillageAmount);
        }
    }