Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
‏‏‎

mika unitycoder

‏‏‎
View GitHub Profile
@unitycoder
unitycoder / TiledSpritesInfinite.cs
Created February 24, 2022 13:05 — forked from kurtdekker/TiledSpritesInfinite.cs
Infinite scrolling sprite background in Unity3D
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// @kurtdekker
// To use:
// import a repeating sprite, FullRect
// drop it on a SpriteRenderer GameObject
// drop this on that same SpriteRenderer you want to be infinitely tiled
//
@unitycoder
unitycoder / FloatingOrigin.cs
Created February 23, 2022 08:56 — forked from brihernandez/FloatingOrigin.cs
Floating origin to handle large worlds in Unity.
// Based on the Unity Wiki FloatingOrigin script by Peter Stirling
// URL: http://wiki.unity3d.com/index.php/Floating_Origin
using UnityEngine;
using UnityEngine.SceneManagement;
public class FloatingOrigin : MonoBehaviour
{
[Tooltip("Point of reference from which to check the distance to origin.")]
public Transform ReferenceObject = null;
@unitycoder
unitycoder / Liquid.shader
Created February 22, 2022 09:54 — forked from josephbk117/Liquid.shader
Unity liquid shader
/*Please do support www.bitshiftprogrammer.com by joining the facebook page : fb.com/BitshiftProgrammer
Legal Stuff:
This code is free to use no restrictions but attribution would be appreciated.
Any damage caused either partly or completly due to usage this stuff is not my responsibility*/
Shader "BitshiftProgrammer/Liquid"
{
Properties
{
_Colour ("Colour", Color) = (1,1,1,1)
_FillAmount ("Fill Amount", Range(-10,10)) = 0.0
@unitycoder
unitycoder / EasingFunctions.cs
Created February 18, 2022 16:14 — forked from cjddmut/EasingFunctions.cs
Easing Functions for Unity3D
/*
* Created by C.J. Kimberlin
*
* The MIT License (MIT)
*
* Copyright (c) 2019
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
@unitycoder
unitycoder / MobileVRHighlight.shader
Created January 17, 2022 07:25 — forked from bgolus/MobileVRHighlight.shader
A mobile VR and MSAA friendly single object highlight shader using the stencil buffer
Shader "Mobile VR Highlight" {
Properties {
_ColorOutline ("Outline", Color) = (1,1,1,1)
_ColorInterior ("Interior", Color) = (0.25,0.25,0.25,0.25)
_ColorInteriorFaded ("Interior Faded", Color) = (0.1,0.1,0.1,0.1)
_ColorInteriorOcc ("Interior Occluded", Color) = (0.15,0.15,0.15,0.15)
_ColorInteriorOccFaded ("Interior Occluded Faded", Color) = (0.05,0.05,0.05,0.05)
_PulseRateMod ("Pulse Rate Modifier", Float) = 4.0
_OutlneWidth ("Outline Pixel Width", Float) = 1.0
}
@unitycoder
unitycoder / CameraEditorMovement.cs
Created November 3, 2021 06:14 — forked from alexmelyon/CameraEditorMovement.cs
Unity camera movement like Editor
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraEditorMovement : MonoBehaviour
{
[Header("Mouse")]
public float lookSpeedH = 2f;
public float lookSpeedV = 2f;
public float zoomSpeed = 2f;
@unitycoder
unitycoder / MouseFinger.cs
Created November 3, 2021 06:13 — forked from alexmelyon/MouseFinger.cs
Send mouse/finger unity events
using UnityEngine;
using UnityEngine.Events;
public class MouseFingerEvent
{
public Vector2 position;
public int index;
}
public class MouseFinger : MonoBehaviour
@unitycoder
unitycoder / gist:ceb32d20509bb4f5a28e4f1cd1f9a7f7
Created October 27, 2021 11:05 — forked from v21/gist:5378391
A script to get a random point on a mesh, for Unity3D
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class RandomPointOnMesh : MonoBehaviour
{
public MeshCollider lookupCollider;
public bool bangGetPoint;
private Vector3 randomPoint;
using UnityEngine;
using UnityEditor;
using UnityEngine.Timeline;
using UnityEngine.Playables;
using System.Collections.Generic;
using UnityEditor.Timeline;
using uOSC;
using UnityEngine.Events;
using EVMC4U;
using VRM;
@unitycoder
unitycoder / Shader paint
Created October 18, 2021 10:42 — forked from eXponenta/Shader paint
Unity Shader for Drawing on RenderTexture with Brush texture
Shader "Region28/MaskedPaint"
{
Properties
{
_MainTex ("Main Texture", 2D) = "white" {}
//_Mask("Mask Texture", 2D) = "white" {}
_Brush("Brush Texture", 2D) = "white" {}
[HideInInspector]_BrushPos("Mask Position", Vector) = (0.5,0.5,0.0,0.0)
_BrushSize("Mask Size", Range(0, 10)) = 1.0
_BrushRotation("Rotation", Range(0, 360)) = 0