This file contains 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 CameraFollow : MonoBehaviour | |
{ | |
public Transform target; | |
public float smoothSpeed = 0.125f; | |
public Vector3 offset; | |
public float forwardOffset = 2f; |
This file contains 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.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
[RequireComponent(typeof(MeshFilter), typeof(MeshRenderer))] | |
public class Grid : MonoBehaviour { | |
public int xSize, ySize; | |
private Vector3[] vertices; | |
private Mesh mesh; |
This file contains 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
Color HexToColor(string hex) | |
{ | |
hex = hex.TrimStart('#'); // Eğer renk kodu başında '#' varsa kaldır | |
Color color = new Color(); | |
color.r = byte.Parse(hex.Substring(0, 2), System.Globalization.NumberStyles.HexNumber) / 255f; | |
color.g = byte.Parse(hex.Substring(2, 2), System.Globalization.NumberStyles.HexNumber) / 255f; | |
color.b = byte.Parse(hex.Substring(4, 2), System.Globalization.NumberStyles.HexNumber) / 255f; | |
if (hex.Length == 8) |
This file contains 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 Cinemachine; | |
/// <summary> | |
/// An add-on module for Cinemachine Virtual Camera that locks the camera's Z co-ordinate | |
/// </summary> | |
[ExecuteInEditMode] [SaveDuringPlay] [AddComponentMenu("")] // Hide in menu | |
public class LockCameraZ : CinemachineExtension | |
{ | |
[Tooltip("Lock the camera's Z position to this value")] |
This file contains 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
{ | |
"m_SGVersion": 2, | |
"m_Type": "UnityEditor.ShaderGraph.GraphData", | |
"m_ObjectId": "e2b331ef653b41b4bf142a758a559a70", | |
"m_Properties": [ | |
{ | |
"m_Id": "97f832e3db3744f1aa1394cae928aff4" | |
} | |
], | |
"m_Keywords": [], |
This file contains 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
private static Vector2 WorldToPixelCoords(Vector3 projectedPoint, Sprite sprite, Transform transform) | |
{ | |
var textureRect = sprite.textureRect; | |
var spriteBounds = sprite.bounds; | |
var localPoint = transform.InverseTransformPoint(projectedPoint); | |
localPoint.x = (localPoint.x - spriteBounds.min.x) / (spriteBounds.size.x); | |
localPoint.y = (localPoint.y - spriteBounds.min.y) / (spriteBounds.size.y); |
This file contains 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 UnityEditor; | |
namespace EditorBehaviourTest | |
{ | |
[InitializeOnLoad] | |
public static class EditorBehaviour | |
{ | |
static EditorBehaviour() | |
{ | |
EditorApplication.playModeStateChanged += OnPlayModeStateChanged; |
This file contains 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
// written by https://github.com/FreyaHolmer so use at your own risk c: | |
using System.Collections.Generic; | |
using UnityEditor; | |
using UnityEngine; | |
/// <summary>Utility functions to copy GUIDs, as well as Copy/Paste import settings</summary> | |
public static class AssetCopyUtils { | |
const int CTX_MENU_LOCATION = 70; |
This file contains 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.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
[RequireComponent(typeof(MeshFilter))] | |
public class PointTracker : MonoBehaviour | |
{ | |
private MeshFilter meshFilter; | |
private Transform[] markers; | |
This file contains 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.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
using UnityEngine; | |
[System.Serializable] | |
public struct SerializedDictionary<T, U> { | |
public List<T> Keys; | |
public List<U> Values; |
NewerOlder