Coder Social home page Coder Social logo

bloopsunityutility's Introduction

BloopsUnityUtility

Various helpful things I like to have around in Unity projects.

Singleton

A robust Singleton system. Turn objects into singletons by just changing their class definition from "class ManagerThing : Monobehaviour" to "class ManagerThing : Singleton". It will lazily load itself on first ManagerThing.Instance get, putting an empty gameObject in the dontDestroyOnLoad scene for you (if needed).

Extensions

Vector2.ClampToCameraScreen Vector3.ClampToCameraScreen Vector2.GetSnap4 Vector2.Snap4 Vector2.Snap8 Vector2.xy (v3->v2) IList.Shuffle (fisher-yates) IList.RandomItem

RequireInterfaceAttribute

[RequireInterface(typeof(type))] public ScriptableObject something;

Event Extensions

Good ol fashion pre-defined list of like "UnityEventBool : UnityEvent<bool>" for lots of basic/unity types.

ColorReference

If I want to use a full ScriptableObjectArchitecture, I will. But if I'm not using that for gameplay, I probably only need a colorReference for non-gameplay things like UI.

Camera Utility

CameraUtility.RectFromTransforms will take a list of transforms and give you a rect of the min and max positions. CameraUtility.SetCameraToRect will adjust an orthographic camera to fit a rect. (note: currently broken oops.)

Camera Transition

goes on camera. Needs the material/shaders too. Just call TransitionOpenCurtain TransitionCloseCurtain, optionally passing a delegate in to be fired when the transition is complete.

It creates a 'blit' component that runs 'blit' onRenderFrame and does its transition through the lerp, the shader code determining what that looks like.

CameraOverlayMat

You can manually add a 'blit' component to the camera and put the overlay material in the slot. This material takes a texture and uses the overlay blend mode. Its a post-processing effect, basically. If you need a more sophisticated post-processing effect than this, please use something else. In fact, a future goal is to simply write an overlay function as a custom PostProc for Unitys package. Let them optimize it.

bloopsunityutility's People

Contributors

hunterdyar avatar

Watchers

 avatar  avatar

bloopsunityutility's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.