Ejemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        float minX = transform.position.x - 0.5f;
        float maxX = transform.position.x + 0.5f;
        float minY = transform.position.y - 0.5f;
        float maxY = transform.position.y + 0.5f;

        if (grid.BlockStarSamePos(this) == true)
        {
            TakenReplace();
        }

        if (minX < player.position.x && maxX > player.position.x && minY < player.position.y && maxY > player.position.y)
        {
            Invoke("Replace", 0.5f);
        }

        if (tradingPost.NewStarPosition() == true)
        {
            GetComponent <SpriteRenderer>().enabled = true;
            taken = false;
        }

        blocked = false;
    }