Skip to content

Instantly share code, notes, and snippets.

View inoto's full-sized avatar
🚩
being strong

Dimka inoto

🚩
being strong
  • Russia
View GitHub Profile
@inoto
inoto / .gitignore
Created May 18, 2020 18:19
For myself
# This .gitignore file should be placed at the root of your Unity project directory
#
# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
#
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Ll]ogs/
///
/// Simple pooling for Unity.
/// Author: Martin "quill18" Glaude ([email protected])
/// Latest Version: https://gist.github.com/quill18/5a7cfffae68892621267
/// License: CC0 (http://creativecommons.org/publicdomain/zero/1.0/)
/// UPDATES:
/// 2015-04-16: Changed Pool to use a Stack generic.
///
/// Usage:
///
using UnityEngine;
using UnityEditor;
using System;
using System.Reflection;
using System.Collections;
using System.Collections.Generic;
namespace UnityCache {
public static class PreCacheEditor {
public static bool WriteToLog = true;
public abstract class Singleton<T> : MonoBehaviour where T : MonoBehaviour
{
public static T Instance { get; private set; }
protected void Awake()
{
if (Instance == null)
{
Instance = this as T;
DontDestroyOnLoad(gameObject);
@inoto
inoto / Ya.cs
Created November 7, 2017 06:36
Extension methods example
namespace SampleNS
{
public static class CommonUtil
{
public static string ListToString(this IList list)
{
StringBuilder result = new StringBuilder("");
if (list.Count > 0)
{
@inoto
inoto / Foo.cs
Created October 26, 2017 17:39
Dispose pattern
class Foo : IDisposable
{
private bool _disposed;
~Foo()
{
Dispose(false);
}
public void Dispose()
{
"Base": {
"HealthMax": 2222,
"ColliderRadius": 1.35,
"ProduceUnitInterval": 3.0,
"SpawnUnitPrefabName": "Drone"
}
}
@inoto
inoto / Customizer.cs
Last active April 13, 2017 09:01
Character customizer ingame
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Customizer : MonoBehaviour
{
public GameObject Panel;
public GameObject Button;