Пример #1
0
    public void OnStartClick()
    {//初始化把所有方块加入map中,取出小狗和目标的坐标
        if (mouse.DogObject != null && mouse.BoneObject != null)
        {
            foreach (var i in Manager.Cubes)
            {
                label1 temp = i.GetComponent <label1>();
                Map[temp.X - 1, temp.Y - 1] = i;
            }
            Player = new Point(mouse.DogObject.GetComponent <label1>().X, mouse.DogObject.GetComponent <label1>().Y, mouse.kind, mouse.gameObject);
            Target = new Point(mouse.BoneObject.GetComponent <label1>().X, mouse.BoneObject.GetComponent <label1>().Y, mouse.kind, mouse.gameObject);
            print("玩家坐标X" + Player.X + ",Y" + Player.Y + ";目标坐标X" + Target.X + ",Y" + Target.Y + "");


            StartCoroutine(A星算法核心());
            isReadly = false;
        }
        else
        {
            return;
        }
    }
Пример #2
0
 (TryGetCorrelation(label1, label2, out var correl, t)) ?