Skip to content

Instantly share code, notes, and snippets.

View starikcetin's full-sized avatar

S. Tarık Çetin starikcetin

View GitHub Profile
@starikcetin
starikcetin / .gitattributes
Last active April 4, 2018 15:51 — forked from FullStackForger/.gitattributes
.gitattributes for Unity3D with git-lfs
# Unity
*.cginc text
*.cs diff=csharp text
*.shader text
# Unity YAML
*.mat merge=unityyamlmerge eol=lf
*.anim merge=unityyamlmerge eol=lf
*.unity merge=unityyamlmerge eol=lf
*.prefab merge=unityyamlmerge eol=lf
@starikcetin
starikcetin / .gitignore
Last active April 4, 2018 15:51
.gitignore for Unity3D
# Exclude all "__GitExcluded__" folders and their meta files.
# Excluded folders can be used for storing test files, builds, backups and local only files.
__GitExcluded__/
__GitExcluded__.meta
# Unity Project Folder
[Ll]ibrary/
[Tt]emp/
[Oo]bj/
[Bb]uild/
@starikcetin
starikcetin / .gitignore
Last active April 5, 2018 19:17
.gitignore for Unity3D third party imports
# ignore all
*
# except the directives file and this gitignore file
!/directives.txt
!/.gitignore
@starikcetin
starikcetin / UnityConstantsGenerator.cs
Last active May 25, 2018 04:43 — forked from dogfuntom/CodeGenerator_Window.cs
[Unity CodeDom] Editor-time code generator. Generates constant-declaration-only classes for Tags, Layers, Sorting layers and Input axes. Good for type-safety. #Unity #Unity3d #CodeDom
using System;
using System.CodeDom;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
@starikcetin
starikcetin / CallbackAggregator.cs
Created June 18, 2019 02:17
Callback aggregator
using System;
using System.Diagnostics.Contracts;
using UnityEngine;
using UnityEngine.Assertions;
namespace starikcetin
{
public class CallbackAggregator
{
private int JobCount { get; set; }
@starikcetin
starikcetin / LICENSE
Created September 3, 2019 15:46 — forked from JohannesMP/LICENSE
[Unity3D] A Reliable, user-friendly way to reference SceneAssets by script.
/*******************************************************************************
* Don't Be a Jerk: The Open Source Software License.
* Adapted from: https://github.com/evantahler/Dont-be-a-Jerk
*******************************************************************************
* _I_ am the software author - JohannesMP on Github.
* _You_ are the user of this software. You might be a _we_, and that's OK!
*
* This is free, open source software. I will never charge you to use,
* license, or obtain this software. Doing so would make me a jerk.
*
// container component
// a constructor is automatically generated for a component that has the same order with field declaration
// for example, for position component following ctor is generated: (x, y, z)
component position
float x
float y
float z
// component with single field
@starikcetin
starikcetin / Instantiator.cs
Last active October 22, 2019 01:31
Unity Edtor-time Prefab Instantiator For Context Menu
using UnityEditor;
using UnityEngine;
internal class Instantiator : ScriptableObject
{
private static Instantiator _instance;
private static Instantiator Instance
{
get
{
@starikcetin
starikcetin / NamespaceFillerAssetProcessor.cs
Last active November 7, 2019 19:21
NamespaceFillerAssetProcessor : Fills in #NAMESPACE# variables in Unity script templates. Source: https://stackoverflow.com/a/52395369/6301627
using System;
using UnityEditor;
using UnityEngine;
public class NamespaceFillerAssetProcessor : UnityEditor.AssetModificationProcessor
{
public static void OnWillCreateAsset(string path)
{
path = path.Replace(".meta", "");
var index = path.LastIndexOf(".", StringComparison.Ordinal);
@starikcetin
starikcetin / Unity3D_character_To_KeyCode.cs
Created August 7, 2021 22:05 — forked from b-cancel/Unity3D_character_To_KeyCode.cs
UNITY 3D => Unity Key Codes to Characters (for MOST keys that display a character when pressed)
//NOTE: This is only a DICTIONARY with MOST character to keycode bindings... it is NOT a working cs file
//ITS USEFUL: when you are reading in your control scheme from a file
//NOTE: some characters SHOULD map to multiple keycodes (but this is impossible)
//since this is a dictionary, only 1 character is bound to 1 keycode
//EX: * from the keyboard will be read the same as * from the keypad... because they produce the same character in a text file
Dictionary<char, KeyCode> chartoKeycode = new Dictionary<char, KeyCode>()
{
//-------------------------LOGICAL mappings-------------------------