This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter_bloc/flutter_bloc.dart'; | |
import 'package:equatable/equatable.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
abstract class CounterEvent extends Equatable { | |
@override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends MaterialApp { | |
const MyApp({Key? key}) : super(home: const TextPage(), key: key); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter_layout_grid/flutter_layout_grid.dart'; | |
import 'package:math_expressions/math_expressions.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatefulWidget { | |
const MyApp({Key? key}) : super(key: key); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using UnityEngine; | |
public class NoInstancing : MonoBehaviour | |
{ | |
private struct MeshData | |
{ | |
public Vector3 offset; | |
public Quaternion rotation; | |
public Color color; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using UnityEngine; | |
using Directory = UnityEngine.Windows.Directory; | |
public class ScreenshotTool : MonoBehaviour | |
{ | |
[SerializeField] private Camera _targetCamera; | |
[SerializeField] private Vector2Int _targetResolution = new Vector2Int(1000, 1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void GetColorAtPosition(ref Vector2Int position) | |
{ | |
float[,,] alphamaps = _terrainData.GetAlphamaps(position.x, position.y, 1, 1); | |
int dominantLayer = 0; | |
// Represents the most dense terrain layer applied at the supplied position | |
float maxDensity = 0f; | |
for (int i = 0; i < alphamaps.GetLength(2); ++i) | |
{ | |
if (alphamaps[0, 0, i] > maxDensity) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Credit: https://www.shadertoy.com/view/lt2GDd | |
half4 hash4(float2 p) | |
{ | |
return frac(sin(float4(1.0 + dot(p, float2(37.0, 17.0)), | |
2.0 + dot(p, float2(11.0, 47.0)), | |
3.0 + dot(p, float2(41.0, 29.0)), | |
4.0 + dot(p, float2(23.0, 31.0)))) * 103.0); | |
} | |
half4 HashedTextureNoTile( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Cysharp.Threading.Tasks; | |
using Opsive.Shared.Game; | |
using UnityEngine; | |
/// <summary> | |
/// This custom tracer will show a Trail Renderer that will travel from | |
/// start point to end point. | |
/// </summary> | |
public class Tracer : MonoBehaviour | |
{ |