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
// Ethan Bruins 2019 | |
// https://gist.github.com/Westerveld/fc81c4f51846c7153df8715fe5b76ddd | |
using UnityEngine; | |
using UnityEditor; | |
public class SetColliderSizeFromScale : EditorWindow | |
{ | |
//Shows up in the hierachy when placed in the GameObject menu | |
[MenuItem("GameObject/Convert Scale To Collider", false, 0)] |
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
/** -- | |
** Copyright (C) 2019 by Josh van den Heever | |
** | |
** Permission is hereby granted, free of charge, to any person obtaining a copy of | |
** this software and associated documentation files (the "Software"), to deal in | |
** the Software without restriction, including without limitation the rights to | |
** use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | |
** of the Software, and to permit persons to whom the Software is furnished to | |
** do so, subject to the following conditions: | |
** |
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
package org.veiset.tsar.world | |
import com.badlogic.gdx.math.Vector2 | |
import org.veiset.tsar.engine2.utils.component1 | |
import org.veiset.tsar.engine2.utils.component2 | |
import org.veiset.tsar.engine2.utils.x | |
import org.veiset.tsar.world.icon.WorldIcon | |
import kotlin.math.absoluteValue | |
import kotlin.math.cos | |
import kotlin.math.pow |
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
/// <summary> | |
/// Collider cache for non allocating physics calls. Lazy loaded. | |
/// </summary> | |
/// <example> | |
/// Usage | |
/// <code> | |
/// float radius = 0.2f; | |
/// int colliderCount = Physics.OverlapSphereNonAlloc(transform.position, radius: radius, results: ColliderCache); | |
/// for (int i = 0; i<colliderCount; i++) { | |
/// ... |
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
using UnityEngine; | |
using System.IO; | |
using System.Collections.Generic; | |
#if UNITY_EDITOR | |
using UnityEditor; | |
#endif | |
public class VoxelTools { | |
#if UNITY_EDITOR |
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
/// FishDrone by JackDraak | |
/// July 2018 | |
/// 'changelog' viewable on GitHub. | |
/// | |
using UnityEngine; | |
public class FishDrone : MonoBehaviour | |
{ | |
private Animator animator; | |
private float changeDelay, changeTime; |
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
// DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
// Version 2, December 2004 | |
// | |
// Copyright (C) 2004 Sam Hocevar <sam@hocevar.net> | |
// | |
// Everyone is permitted to copy and distribute verbatim or modified | |
// copies of this license document, and changing it is allowed as long | |
// as the name is changed. | |
// | |
// DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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
/************************************************************ | |
* Better Singleton by David Darias | |
* Use as you like - credit where due would be appreciated :D | |
* Licence: WTFPL V2, Dec 2014 | |
* Tested on Unity v5.6.0 (should work on earlier versions) | |
* 03/02/2017 - v1.1 | |
* **********************************************************/ | |
using System; | |
using UnityEngine; |
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
using System.Collections.Generic; | |
using UnityEngine; | |
public class Pool : MonoBehaviour | |
{ | |
private const int DEFUALT_POOL_SIZE = 100; | |
private static Dictionary<IPoolable, Pool> pools = new Dictionary<IPoolable, Pool>(); | |
public static Pool GetPool(IPoolable prefab) |
NewerOlder