Пример #1
0
    void OnEnable()
    {
        GameLog.Associate(this);
        GameObject playerList = GameObject.FindWithTag("PlayerList");

        if (playerList != null)
        {
            Destroy(playerList);
        }

        cam    = Camera.main;
        canvas = GameObject.FindGameObjectWithTag("Canvas");
        layerMaskBoardIntersection = LayerMask.GetMask("BoardIntersection");
        gridColliders = new Dictionary <Collider2D, int>();

        width  = 19;
        height = 19;
        transform.localPosition = new Vector3(-6, 0, 0);
        stones = new byte[width * height];
        for (int i = 0; i < stones.Length; i++)
        {
            stones[i] = NO_PLAYER;
        }
        DrawBoard();

        stoneObjects = new GameObject[stones.Length];
        allianceAdjacencyIndicators = new Dictionary <Tuple <int, int, bool>, GameObject>();
        captureIndicators           = new List <GameObject>();
    }