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
System.Version MyVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; | |
// MyVersion.Build = days after 2000-01-01 | |
// MyVersion.Revision*2 = seconds after 0-hour (NEVER daylight saving time) | |
DateTime MyTime = new DateTime(2000, 1, 1).AddDays(MyVersion.Build).AddSeconds(MyVersion.Revision * 2); | |
return string.Format("Version:{0} Compiled:{1:s}", MyVersion, MyTime); |
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 class SatsManger | |
{ | |
private Dictionary<string, BaseSwindleStat> allStats = new Dictionary<string, BaseSwindleStat>(); // a collection of all the stats that we could unlock | |
private Dictionary<string, BaseSwindleStat> unlockedStats = new Dictionary<string, BaseSwindleStat>(); // a collection of stats we have unlocekd. | |
public bool HasUnlockedStat(string statName) | |
{ | |
return unlockedStats.ContainsKey(statName); | |
} |
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 class PatrolBehavior : LoopNode | |
{ | |
private int minimumPatrolTime = 4; | |
private int patrolTimeModifier = 8; | |
public PatrolBehavior() | |
{ | |
// The Patrol Behavior has two major parts, a timer/skillcheck to decide how long it runs for and movement/flip branch. | |
Parallel | |
( |
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 class Sprite | |
{ | |
private Color tint; // this is a normal field. its private, so only we can see it. | |
// THIS IS BAD DONT DO IT :) public Color tint; // this is a public field. Any other class can see it, this is what you would do in java. in C# this is bad code! | |
// this is a property, and the way you should expose data to other classes. Use it to wrap a varible up. this means if later you decided you want to let tint be shades of red, you just change the set method to enforce that new rule. you dont have to go though allll the code that sets tint and change that to enfore a new data rule. | |
public Color Tint | |
{ | |
get { return tint;} | |
set { tint= value;} |
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
[CustomEditor(typeof(Transform))] | |
public class Transform2DInspector : Editor | |
{ | |
public override void OnInspectorGUI() | |
{ | |
// Grab the target transform | |
Transform transform = (Transform)target; | |
tk2dBaseSprite sprite = transform.gameObject.GetComponent<tk2dBaseSprite>(); | |
if (sprite != null) |
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
EditorGUILayout.BeginHorizontal(EditorStyles.toolbar); | |
GUILayout.Label("Toolbar Title"); | |
GUILayout.FlexibleSpace(); | |
if (GUILayout.Button("A", EditorStyles.toolbarButton)) | |
{ | |
// does something | |
} | |
if (GUILayout.Button("B", EditorStyles.toolbarButton)) | |
{ | |
// does something |
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
// attach this to a camera. It sets the sort mode so 2D object are rendered correctly with a perspective camera. | |
public class CameraSortModeSetter : MonoBehaviour | |
{ | |
void Update() | |
{ | |
if (camera != null && camera.transparencySortMode != TransparencySortMode.Orthographic) | |
camera.transparencySortMode = TransparencySortMode.Orthographic; | |
} | |
} |
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 static class StringExtentions | |
{ | |
//bad word list specal thanks to google! (https://gist.github.com/jamiew/1112488) | |
private static string[] badwords = new[] { "4r5e", "5h1t", "5hit", "a55", "anal", "anus", "ar5e", "arrse", "arse", "ass", "ass-fucker", "asses", "assfucker", "assfukka", "asshole", "assholes", "asswhole", "a_s_s", "b!tch", "b00bs", "b17ch", "b1tch", "ballbag", "balls", "ballsack", "bastard", "beastial", "beastiality", "bellend", "bestial", "bestiality", "bi+ch", "biatch", "bitch", "bitcher", "bitchers", "bitches", "bitchin", "bitching", "bloody", "blow job", "blowjob", "blowjobs", "boiolas", "bollock", "bollok", "boner", "boob", "boobs", "booobs", "boooobs", "booooobs", "booooooobs", "breasts", "buceta", "bugger", "bum", "bunny fucker", "butt", "butthole", "buttmuch", "buttplug", "c0ck", "c0cksucker", "carpet muncher", "cawk", "chink", "cipa", "cl1t", "clit", "clitoris", "clits", "cnut", "cock", "cock-sucker", "cockface", "cockhead", "cockmunch", "cockmuncher", "cocks", "cocksuck", |
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 override void OnInspectorGUI2() | |
{ | |
// First off, cache a copy of target cast to its type, makes like easier. EXAMPLE | |
AmbientLight light = target as AmbientLight; | |
// This is to top area of the inspector GUI. draw controls here for making chages to parts of the target object that arnt part of the array. | |
light.timeOfDay = EditorGUILayout.Slider("Time of Day", light.timeOfDay, 0, 24); | |
// leave some space to split the main settings from the array | |
EditorGUILayout.Space(); |
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
#============================================================================== | |
# ** Game_Unit | |
#------------------------------------------------------------------------------ | |
# This class handles units. It's used as a superclass of the Game_Party and | |
# and Game_Troop classes. | |
#============================================================================== | |
class Game_Unit | |
#-------------------------------------------------------------------------- | |
# * Public Instance Variables |
OlderNewer