Example #1
0
    void InstantiatePressurePlate(Vector2Int position, int colCount, int rowCount)
    {
        GameObject pressurePlateGO = Instantiate(pressurePlatePrefab,
                                                 getWorldPosition(position.x, position.y, rowCount, colCount, -1),
                                                 pressurePlatePrefab.transform.rotation, contentParent);
        PressurePlate pressureComponent = pressurePlateGO.GetComponent <PressurePlate>();

        pressureComponent.Initialize(position);
    }