Skip to content

Instantly share code, notes, and snippets.

View gakkossphynx's full-sized avatar
💯
Work-Work-Work-Work-Work-Work-Work-Work-Work-Work-Work-Work-Work-Work-Work-Work

SPHYNX gakkossphynx

💯
Work-Work-Work-Work-Work-Work-Work-Work-Work-Work-Work-Work-Work-Work-Work-Work
  • TR
View GitHub Profile
using UnityEngine;
using System.Collections;
using System.Security.Cryptography;
using System.Text;
public class EncryptedPlayerPrefs {
// Encrypted PlayerPrefs
// Written by Sven Magnus
// MD5 code by Matthew Wegner (from [url]http://www.unifycommunity.com/wiki/index.php?title=MD5[/url])
@MadLittleMods
MadLittleMods / CharacterDriver.cs
Last active March 15, 2022 09:24
Unity Character Driver/Controller for Movement, Jumping, and Gravity
using UnityEngine;
using System.Collections;
[RequireComponent (typeof(CharacterController))]
public class CharacterDriver : MonoBehaviour {
public class CharacterState
{
public Vector3 position = new Vector3();
@soyliquid
soyliquid / SmoothSyncObject.cs
Last active May 16, 2023 08:25
[Unity][Photon]GameObjectの位置と回転、Animatorを同期する
using UnityEngine;
using Hashtable = ExitGames.Client.Photon.Hashtable;
public class SmoothSyncObject : MonoBehaviour
{
public PhotonView OwnerView;
public GameObject[] SyncTargets;
public Animator SycnAnimator;
// public int RootTargetId = 0; // target which affects position.
private bool isDeltaTimeBasedSmoothing = false;
@Fonserbc
Fonserbc / Easing.cs
Last active June 16, 2024 23:00
Compact and simple easing functions for Unity
using UnityEngine;
/*
* Most functions taken from Tween.js - Licensed under the MIT license
* at https://github.com/sole/tween.js
* Quadratic.Bezier by @fonserbc - Licensed under WTFPL license
*/
public delegate float EasingFunction(float k);
public class Easing
@fadookie
fadookie / CameraAnchor.cs
Last active April 29, 2024 12:19
Screen-relative anchoring component for Unity3D. Find more Unity code at http://www.eliotlash.com/2015/01/unity3d-components-and-code-snippets/
/***
* This script will anchor a GameObject to a relative screen position.
* This script is intended to be used with ViewportHandler.cs by Marcel Căşvan, available here: http://gamedev.stackexchange.com/a/89973/50623
* It is also copied in this gist below.
*
* Note: For performance reasons it's currently assumed that the game resolution will not change after the game starts.
* You could not make this assumption by periodically calling UpdateAnchor() in the Update() function or a coroutine, but is left as an exercise to the reader.
*/
/* The MIT License (MIT)
@timofei7
timofei7 / Singleton.cs
Last active October 1, 2022 10:06
unity3d c# singleton class with automatic prefab loading
using UnityEngine;
using System.Collections;
using System;
/// <summary>
/// Prefab attribute. Use this on child classes
/// to define if they have a prefab associated or not
/// By default will attempt to load a prefab
/// that has the same name as the class,
/// otherwise [Prefab("path/to/prefab")]
@gunderson
gunderson / FlyCamera.cs
Last active June 27, 2024 15:18
Unity Script to give camera WASD + mouse control
using UnityEngine;
using System.Collections;
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.
Simple flycam I made, since I couldn't find any others made public.
Made simple to use (drag and drop, done) for regular keyboard layout
@zalo
zalo / MovingPlatform.cs
Last active April 5, 2023 06:38
Physics-Based Unity Player Controller
using UnityEngine;
public class MovingPlatform : MonoBehaviour {
public float timeInterval = 5f;
public AnimationCurve XMotion;
public AnimationCurve YMotion;
public AnimationCurve ZMotion;
public bool PingPong = true;
float platformTime;
@matthewzring
matthewzring / markdown-text-101.md
Last active July 24, 2024 06:37
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers:

@ditzel
ditzel / CameraAspectRatioScaler.cs
Last active August 19, 2023 13:19
ResponsiveCamera
using UnityEngine;
/// <summary>
/// Responsive Camera Scaler
/// </summary>
public class CameraAspectRatioScaler : MonoBehaviour {
/// <summary>
/// Reference Resolution like 1920x1080
/// </summary>