Skip to content

Instantly share code, notes, and snippets.

using UnityEngine;
public class SpriteScroll : MonoBehaviour
{
[SerializeField]
private float scrollSpeed = 1f;
private float rightEdge;
private float leftEdge;
private Vector3 distanceBetweenEdges;
using UnityEngine;
using UnityEngine.UI;
public class ChooseRandomColor : MonoBehaviour
{
public void ChangeImageColor()
{
GetComponent<Image>().color = RandomColor();
}
using UnityEngine;
using UnityEngine.UI;
public class ChooseRandomColor : MonoBehaviour
{
private void Start()
{
GetComponent<Button>().onClick.AddListener(ChangeImageColor);
}
using UnityEngine;
public class GroundPlacementController : MonoBehaviour
{
[SerializeField]
private GameObject placeableObjectPrefab;
[SerializeField]
private KeyCode newObjectHotkey = KeyCode.A;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
using UnityEngine.UI;
public class ImageLoader : MonoBehaviour
{
[SerializeField]
using System.Collections;
using UnityEngine;
[RequireComponent(typeof(SteamVR_TrackedController))]
public class DashController : MonoBehaviour
{
[SerializeField]
private float minDashRange = 0.5f;
[SerializeField]
private float maxDashRange = 40f;
using System.IO;
using System.IO.Compression;
public static class ByteArrayExtensions
{
public static byte[] Compress(this byte[] raw)
{
using (MemoryStream memory = new MemoryStream())
{
using (GZipStream gzip = new GZipStream(memory,CompressionMode.Compress, true))
using UnityEngine;
using UnityEngine.UI;
public class BrushSizeSlider : MonoBehaviour
{
private Slider slider;
public static int BrushSize { get; private set; }
private void Start()
using UnityEngine;
using UnityEngine.Networking;
public class PlayerBrush : NetworkBehaviour
{
#region Initialization
[Server]
private void Start()
{
var data = PaintCanvas.GetAllTextureData();
using UnityEngine;
public class ColorPicker : MonoBehaviour
{
public static Color SelectedColor { get; private set; }
[SerializeField]
private Renderer selectedColorPreview;
private void Update()