Made by https://twitter.com/Lordinarius Original post: https://twitter.com/Lordinarius/status/704276303139184641 Original source: https://bitbucket.org/snippets/Lordinarius/nrn4L
This file contains hidden or 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 UnityEngine; | |
| using System.Collections; | |
| public class Example : MonoBehaviour | |
| { | |
| public ExampleClass example; | |
| void Start() {} | |
| void Update() {} | |
| } |
This file contains hidden or 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
| public LayerMask layerMask = 1 << 0; // default layer (0) | |
| public LayerMask layerMask2 = ~0; // everything | |
| public LayerMask layerMask2b = -1; // everything | |
| public LayerMask layerMask3 = default;// nothing | |
| public LayerMask layerMask4 = 0;// nothing | |
| public LayerMask layerMask4b; // nothing | |
| public LayerMask layerMask5 = 1 << 5;// layer 5 (UI) | |
| public LayerMask layerMask6 = 1 << 2 | 1 << 5;// Ignore Raycast (Layer 2) AND UI (Layer 5) | |
| public LayerMask layerMask7 = ~(1 << 4 | 1 << 5); // all except layer 4 and 5 | |
| public LayerMask layerMask8 = ~(1 << 4); // all except layer 4 |
This file contains hidden or 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 UnityEngine; | |
| using System.Linq; | |
| [RequireComponent(typeof(Rigidbody))] | |
| public class RigidbodyMassCalculator : MonoBehaviour { | |
| public float density = 1f; | |
| public bool recalculateOnAwake = true; | |
| Rigidbody rb; |
This file contains hidden or 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 UnityEngine; | |
| using UnityEngine.UI; | |
| /* | |
| Radial Layout Group by Just a Pixel (Danny Goodayle) - http://www.justapixel.co.uk | |
| Copyright (c) 2015 | |
| 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 | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
This file contains hidden or 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 UnityEngine; | |
| using System.Collections; | |
| using UnityEngine.Events; | |
| namespace Cluster { | |
| public class CollisionCall : MonoBehaviour { | |
| public LayerMask layerMask = -1; |
This is a compilation of various open-source Unity plugins, codebases, or utility scripts that may aid in expediting the development process.
"ProbePolisher is a Unity Editor plugin for editing light probes. It works both on Unity Basic (free) and Unity Pro."
This file contains hidden or 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
| // BatchRename.cs | |
| // Unity Editor extension that allows batch renaming for GameObjects in Hierarchy | |
| // Via Alan Thorn (TW: @thorn_alan) | |
| using UnityEngine; | |
| using UnityEditor; | |
| using System.Collections; | |
| public class BatchRename : ScriptableWizard { |
This file contains hidden or 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
| /** | |
| * Retrieves all the rows in the active spreadsheet that contain data and logs the | |
| * values for each row. | |
| * For more information on using the Spreadsheet API, see | |
| * https://developers.google.com/apps-script/service_spreadsheet | |
| */ | |
| function readRows() { | |
| var sheet = SpreadsheetApp.getActiveSheet(); | |
| var rows = sheet.getDataRange(); | |
| var numRows = rows.getNumRows(); |
This file contains hidden or 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 UnityEngine; | |
| using System.Collections; | |
| // This is basically how the Super Metroid camera worked. Whichever direction you moved, the camera would | |
| // move in the same direction a multiple of the player's speed. Once the center of the camera moved a | |
| // certain distance from the player, the camera would lock on the player and move the same speed. Change | |
| // movement direction, and the camera would once again move more quickly to catch up and place itself | |
| // ahead of the player's movement. | |
| // Super Metroid also had area limits and locked certain axes based on where you were. For instance, if |