Skip to content

Instantly share code, notes, and snippets.

View ezonecom's full-sized avatar

Simon Edis ezonecom

View GitHub Profile
@yaeda
yaeda / AssetBundleSample.cs
Created April 18, 2013 07:30
Unity AssetBundle Examples.
using System;
using UnityEngine;
using System.Collections;
public class AssetBundleSample : MonoBehaviour {
public GUIText guitext;
// Use this for initialization
void Start () {
@bitbutter
bitbutter / TransparentBackgroundScreenshotRecorder.cs
Last active February 1, 2025 23:54
Rendering screenshots from Unity3d with transparent backgrounds
using UnityEngine;
using System.Collections;
using System.IO;
/*
Usage:
1. Attach this script to your chosen camera's game object.
2. Set that camera's Clear Flags field to Solid Color.
3. Use the inspector to set frameRate and framesToCapture
@t0chas
t0chas / CustomEditorBase.cs
Last active September 2, 2024 06:54
Default Custom Inspector-Editor for Unity3D with ReorderableLists for arrays handling
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
using System.Collections.Generic;
using UnityEditor.AnimatedValues;
[CustomEditor(typeof(UnityEngine.Object), true, isFallback = true)]
[CanEditMultipleObjects]
public class CustomEditorBase : Editor
{
@MattRix
MattRix / PhysicsFollower.cs
Last active August 8, 2024 00:25
A thing you can use to make a rigidbody move towards a position reliably
using UnityEngine;
using System.Collections;
using System;
[RequireComponent (typeof(Rigidbody))]
public class PhysicsFollower : MonoBehaviour
{
public Transform target;
Rigidbody rb;
/*
Basic Sprite Shader for aligning pixel art to the same grid, based on the Unity Sprite Shader.
Create one Material where you assign the same Pixels Per Unit value you use on your imported Sprites,
then reuse this Material on all appropriate Sprite Renderers.
(You can use Shader.SetGlobalFloat to set that Pixels Per Unit value for all your shaders:
https://docs.unity3d.com/ScriptReference/Shader.SetGlobalFloat.html)
This is not for scaled or rotated artwork. If you need those features, look at low res render textures.
Use this however you want.
@konsfik
konsfik / WaterController.cs
Created March 26, 2017 23:21
Procedural Water Surface, c#, Unity3D
using System.Collections;
using System.Collections.Generic;
using System.Linq; //required inorder to convert list to array
using UnityEngine;
/* Source Code written by Kostas Sfikas, March 2017
Tested with Unity 5.5.0 f3 Pesonal edition*/
[RequireComponent(typeof(MeshFilter))] // making sure that the gameobject has a MeshFilter component
[RequireComponent(typeof(MeshRenderer))] // making sure that the gameobject has a MeshRenderer component
@TiliSleepStealer
TiliSleepStealer / DoomGlow.cs
Created June 13, 2017 21:45
Doom glow - fake volumetric light glow effect in Unity by Tili_us
// This file is in the public domain. Where
// a public domain declaration is not recognized, you are granted
// a license to freely use, modify, and redistribute this file in
// any way you choose.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// Unity remake of a fake volumetric light glow effect
@yasirkula
yasirkula / IAPManager.cs
Created November 4, 2021 14:35
A wrapper script for Unity IAP (In-App Purchases) that can be used for common IAP tasks
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Purchasing;
using UnityEngine.Purchasing.Security;
public class IAPManager : IStoreListener
{
public enum State { PendingInitialize, Initializing, SuccessfullyInitialized, FailedToInitialize };
@Furnyr
Furnyr / unity_embedded_app_sdk_1.md
Last active November 28, 2024 00:42
Using Unity 2022.3.8f1 with the Discord Embedded App SDK

April 13, 2024 Edit

I recently published the first complete version of a project that can help with creating activities with Unity. If you want to check it out here's the repository: Dissonity

Introduction

This file contains information about my experience using Unity with the Embedded App SDK, so if you plan to make a Discord activity with Unity you may find this helpful. I am not a professional developer though, and the SDK has become public just recently, so take my words with a pinch of salt.

I used Unity 2022.3.8f1, I haven't tested other versions but it may work similarly.