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 UnityEditor; | |
public static class Wm { | |
const string DATABASE_ID_KEY = "MyCustomDatabase"; | |
public static MyScriptableObject _db; | |
public static MyScriptableObject Db { | |
get { | |
if (_db == null && EditorPrefs.HasKey(DATABASE_ID_KEY)) { | |
_db = GetDatabaseFromStorage(); |
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
# EditorConfig helps developers define and maintain consistent | |
# coding styles between different editors and IDEs | |
# editorconfig.org | |
# @NOTE You can add specific files to the .editorconfig, see https://github.com/angular/angular.js/blob/master/.editorconfig | |
# Ex. [htmlparser.js] | |
# My properties | |
root = true |
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 System.Collections; | |
static public class Vector3Ext { | |
/// <summary> | |
/// Gives absolute distance instead of returning a negative value. | |
/// </summary> | |
/// <returns>The all.</returns> | |
/// <param name="pos1">Pos1.</param> | |
/// <param name="pos2">Pos2.</param> |
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
{ | |
"strings": { | |
"checkpoint": "TestingNorth", | |
"RespawnLastScene": "TestingNorth" | |
}, | |
"ints": {}, | |
"floats": {}, | |
"bools": { | |
"5611dcfb-00c3-4c00-bd6e-e81a8ac221b1_on": true, | |
"442792d8-8fe0-4f56-b614-e903bcb43609_on": true, |
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; | |
namespace HutongGames.PlayMaker.Actions { | |
[ActionCategory(ActionCategory.Color)] | |
[Tooltip("Select a random Color between two Colors.")] | |
public class RandomBetweenColors : FsmStateAction { | |
public FsmColor color1; | |
public FsmColor color2; | |
[RequiredField] |
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 System.Collections; | |
namespace Adnc.Cam { | |
public class Camera2DFollow : MonoBehaviour { | |
Vector3 currentVelocity; // Velocity used for damping camera movement | |
[Tooltip("Draws debug lines representing the camera's move logic (easing only)")] | |
[SerializeField] bool debug; |
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 System.Collections; | |
using System.Collections.Generic; | |
public class ParticleThrower : MonoBehaviour { | |
public class ParticleData { | |
public Rigidbody2D body; | |
public Vector2 force; | |
public float torque; |
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 System.Collections; | |
namespace Adnc.Combat { | |
[System.Serializable] | |
public class StatHealth { | |
[Tooltip("Set health manually")] | |
[SerializeField] int health; | |
int healthMax; | |
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
// @NOTE Must be called from FixedUpdate() to work properly | |
void NormalizeSlope () { | |
// Attempt vertical normalization | |
if (grounded) { | |
RaycastHit2D hit = Physics2D.Raycast(transform.position, -Vector2.up, 1f, whatIsGround); | |
if (hit.collider != null && Mathf.Abs(hit.normal.x) > 0.1f) { | |
Rigidbody2D body = GetComponent<Rigidbody2D>(); | |
// Apply the opposite force against the slope force | |
// You will need to provide your own slopeFriction to stabalize movement |
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 System.Collections; | |
using UnityEngine.UI; | |
public class CameraFade : MonoBehaviour { | |
public static CameraFade current; | |
public delegate void Callback(); | |
[SerializeField] bool debug; |