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; | |
| public class GunSprint : MonoBehaviour { | |
| [SerializeField] private Bullet _bulletPrefab; | |
| [SerializeField] private Transform _spawnPoint; | |
| [SerializeField] private ParticleSystem _smokeSystem; | |
| [SerializeField] private LayerMask _targetLayer; | |
| [SerializeField] private float _bulletSpeed = 12; | |
| [SerializeField] private float _torque = 120; |
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.InputSystem; | |
| public class FlyCamera : MonoBehaviour | |
| { | |
| /* | |
| Writen by Windexglow 11-13-10. Use it, edit it, steal it I don't care. | |
| Converted to C# 27-02-13 - no credit wanted. |
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; | |
| #if UNITY_EDITOR | |
| using UnityEditor; | |
| #endif | |
| // @kurtdekker - ultra Cheesy grid with in-built editor for Unity3D | |
| // | |
| // To use: | |
| // make an empty game object | |
| // drag this script on it |
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
| #if UNITY_EDITOR | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| using UnityEditor; | |
| using System.Reflection; | |
| public class EditorFontSize : EditorWindow | |
| { | |
| // enable resize on launch to set a default font size , using this option will disable the ability to have the window accassible |
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; | |
| /// <summary> | |
| /// Keeps constant camera width instead of height, works for both Orthographic & Perspective cameras | |
| /// Made for tutorial https://youtu.be/0cmxFjP375Y | |
| /// </summary> | |
| public class CameraConstantWidth : MonoBehaviour | |
| { | |
| public Vector2 DefaultResolution = new Vector2(720, 1280); | |
| [Range(0f, 1f)] public float WidthOrHeight = 0; |
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 System; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| public class MeshDestroy : MonoBehaviour | |
| { | |
| private bool edgeSet = false; | |
| private Vector3 edgeVertex = Vector3.zero; | |
| private Vector2 edgeUV = Vector2.zero; |
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
| Shader "Custom/MobileOcclusion" | |
| { | |
| SubShader { | |
| Pass { | |
| // Render the Occlusion shader before all | |
| // opaque geometry to prime the depth buffer. | |
| Tags { "Queue"="Geometry" } | |
| ZWrite On | |
| ZTest LEqual |
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 System.Collections.Generic; | |
| using UnityEditor; | |
| // Replaces Unity terrain trees with prefab GameObject. | |
| // http://answers.unity3d.com/questions/723266/converting-all-terrain-trees-to-gameobjects.html | |
| [ExecuteInEditMode] | |
| public class TreeReplacerS : EditorWindow { |
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
| Shader "BendMesh" | |
| { | |
| Properties | |
| { | |
| _Texture("Texture", 2D) = "white" {} | |
| _Color("Color", Color) = (0,0,0,0) | |
| _Amplitude("Amplitude", Float) = 0 | |
| _Frequency("Frequency", Float) = 0 | |
| _OffsetSin("OffsetSin", Float) = 0 | |
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; | |
| /// <summary> | |
| /// Resizes a UI element with a RectTransform to respect the safe areas of the current device. | |
| /// This is particularly useful on an iPhone X, where we have to avoid the notch and the screen | |
| /// corners. | |
| /// | |
| /// The easiest way to use it is to create a root Canvas object, attach this script to a game object called "SafeAreaContainer" | |
| /// that is the child of the root canvas, and then layout the UI elements within the SafeAreaContainer, which | |
| /// will adjust size appropriately for the current device./// </summary> |
NewerOlder