Пример #1
0
    public static bool othergotoNewCell(GameObject newCell, int ida)
    {
        ClicCell c;

        if (ida == 1)
        {
            c = otherplayer1.Cells.GetComponent <ClicCell>();
        }
        else
        {
            c = otherplayer2.Cells.GetComponent <ClicCell>();
        }
        var c2 = newCell.GetComponent <ClicCell>();
        //Debug.Log("c : " + c);
        //Debug.Log("c2.crosable : " + c2.crosable);
        //Debug.Log("ida : " + ida);
        int dist = ClicCell.distanceCells(c, c2);

        //	Debug.Log("dist : " + dist);
        if (otherplayer1.curPM >= dist && ida == 1 && c2.crosable)
        {
            OtherPlayerControler.setTransform(otherplayer1, newCell, dist);
            reachGlobalUpdate(CellsTab);
            return(true);
        }
        if (otherplayer2.curPM >= dist && ida == 2 && c2.crosable)
        {
            OtherPlayerControler.setTransform(otherplayer2, newCell, dist);
            reachGlobalUpdate(CellsTab);
            return(true);
        }
        return(false);
    }