Beispiel #1
0
    void OnMouseUp()
    {
        int value = level5.GetMapValue((int)x, (int)y);

        if (value == 0)
        {
            if (heroscript.walk == false && heroscript.finish == false && moneyscript.walk == false && moneyscript.finish == false)
            {
                level5.SetMap((int)x, (int)y, 2);                 //设置地图
                heroscript.InitGame();
                moneyscript.InitGame();
                if (heroscript.astar.findPath(heroscript.grid) == true && moneyscript.astar.findPath(moneyscript.grid) == true && avalueblock > 0)
                {
                    GameObject down = Instantiate(rock, new Vector2(x * 64 + 32, y * 64 + 32), Quaternion.Euler(new Vector3(0, 0, 0))) as GameObject;
                    avalueblock--;
                }
                else
                {
                    level5.SetMap((int)x, (int)y, 0);                     //设置地图
                }
            }
        }
    }