예제 #1
0
    public void findPath(Hex start2)
    {
        curentPath = new List <Hex>();



        curentPath = FindPath.FindPathInHex(start, start2, hexRangeMove);
        curentPath.Reverse();
        if (curentPath.Count > 0 && isWalkNow == false)
        {
            Hex        curentselectHex = layot.Vector3ToHex(transform.position);
            GameObject curenTile       = menagerScript.FindMapTileFromHex(curentselectHex);
            GameObject curent          = curenTile.GetComponent <MapTile>().curentTileSelect;
            curent.GetComponent <MeshRenderer>().enabled = false;
            DeactivAllArrow();

            bool isHaveShotgunEqip = animator.GetBool("Equipshotgun");
            if (isHaveShotgunEqip == true)
            {
                animator.SetBool("shotgunWalk", true);
            }
            else
            {
                animator.SetBool("isWalkNow", true);
            }

            StartCoroutine(TravelWithCurentPath(curentPath));

            /*foreach (var item in curentPath)
             * {
             *  GameObject to = GameObject.CreatePrimitive(PrimitiveType.Cube);
             *  to.transform.position = layot.HexToVector3(item);
             *
             * }*/
            // GameObject to = GameObject.CreatePrimitive(PrimitiveType.Cube);
            // to.transform.position = layot.HexToVector3(curentPath[1]);
        }
    }