コード例 #1
0
    private void InitializeAll()
    {
        Camera.main.orthographicSize = ((ColumnCount + 1) / 2) + 1;

        _displayColors = ColorFactory.GrayScaleReversed(5);

        int stateLength = (ColumnCount * RowCount);

        _displayState = new NativeArray <byte>(stateLength, Allocator.Persistent);

        _myConwayState        = new ConwayStateClass(ColumnCount, RowCount); ///ushort -> byte for params
        _myConwayDisplayState = new ConwayDisplayState(_displayState, _myConwayState._indexer);


        if (_mirrorDisplay)
        {
            SetMirroredDisplayState();
        }
        else
        {
            SetSimpleDisplayState();
        }

        GenerateDisplay();

        UpdateDisplay();
    }
コード例 #2
0
    // Start is called before the first frame update
    void Start()
    {
        cells = new GameObject[rowCount * columnCount];
        GenerateGrid();
        this.transform.Translate(-columnCount * .5f, -rowCount * .5f, 0);

        colors = ColorFactory.GrayScaleReversed(5);

        foreach (var color in colors)
        {
            Debug.Log("color:" + color);
        }
    }