Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
Coding... 01101000 01100101 01101100 01101100 01101111

arkms

👨‍💻
Coding... 01101000 01100101 01101100 01101100 01101111
View GitHub Profile
@arkms
arkms / BoxCollider2DAlwaysVisible
Created Jun 1, 2016
Make always visible a BoxCollider2D in Unity Editor.
View BoxCollider2DAlwaysVisible
using UnityEngine;
[ExecuteInEditMode]
public class BoxCollider2DAlwaysVisible : MonoBehaviour
{
public Color color = Color.white;
private BoxCollider2D BoxCollider;
void Start()
@arkms
arkms / Sceneview_follow
Created Jun 1, 2016
Make the Scene view move and follow a camara (2D)
View Sceneview_follow
#define AUTO_SCENEVIEW //Comentar para dejar de perseguir y poder controlar la pestaña de escena en modo Play
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
public class sceneview_follow : MonoBehaviour
{
#if UNITY_EDITOR && AUTO_SCENEVIEW
@arkms
arkms / DisableAutoMipMaps
Created Jun 1, 2016
Make all new texture has MipMaps disable. Remember save inside a 'Editor' folder
View DisableAutoMipMaps
using UnityEngine;
using UnityEditor;
public class DisableAutoMipMaps : AssetPostprocessor
{
public void OnPreprocessTexture()
{
TextureImporter texture = assetImporter as TextureImporter;
texture.mipmapEnabled = false;
}
@arkms
arkms / DebugX
Created Jun 27, 2016
DebugX version 2.0
View DebugX
using UnityEngine;
public static class DebugX
{
// DebugX.cs Version 2.0 By ARKMS
// Hayden Scott-Baron (Dock) - http://starfruitgames.com
// Adds a number of useful Debug Draw features
public static void DrawCube(Vector3 pos, Color col, Vector3 scale, float _duration = 0f)
{
Vector3 halfScale = scale * 0.5f;
@arkms
arkms / cUpdate
Created Oct 5, 2016
Costum Update with delays between every call
View cUpdate
//Intervalo entre cada Update,, la ventaja es que podemos cambiar
//su valor ya sea dentro del mismo cUpdate o desde otra función.
float intervalos = 0.5f;
void Start()
{
StartCoroutine(cUpdate());
}
@arkms
arkms / RielesLerp
Created Nov 8, 2016
Rieles con Lerp
View RielesLerp
public float Velocidad;
public Transform[] Puntos;
//Internos
int IndexActual = 0; //Index para mover en puntos
Vector3 PuntoA; //Punto A para Lerp
Vector3 PuntoB; //Punto B para Lerp
float t; //Factor tiempo de Lerp
float factorT; //Factor de moviemnto
@arkms
arkms / SaveData.cs
Created Mar 3, 2017
A easy and fast way to save a lot of vars in Unity
View SaveData.cs
using UnityEngine;
public class SaveData : MonoBehaviour
{
public SAVEDATACLASS progreso; //es visible desde Inspector
public void Guardar()
{
//Generamos el formato Json
string Archivo = JsonUtility.ToJson(progreso);
@arkms
arkms / ResourcesCheckConflict.cs
Created May 10, 2017
A simple script that check if exist some conflict with all Resources folders in project. For use it just go to ' Window/ResourcesCheckConflict '
View ResourcesCheckConflict.cs
//This script put inside a Folder with the name 'Editor'
//Developer by ARKMs , use it with total liberty
using UnityEngine;
using UnityEditor;
using System;
using System.IO;
using System.Collections.Generic;
@arkms
arkms / ConstantsGeneratorKit.cs
Created Jun 7, 2017
Script que automáticamente genera otros scripts que tiene los Tags, Layers y Sorting Layers del proyecto para trabajar con ellos en un script de manera sencilla, simplemente se debe actualizar llamando 'Edit/Generate Constants Classes'
View ConstantsGeneratorKit.cs
using UnityEngine;
using UnityEditor;
using System;
using System.Text.RegularExpressions;
using System.IO;
using System.Linq;
using System.Reflection;
//Basado en codigo de Prime31Editor
//Poner siempre este script dentro de una carpeta llamado 'Editor'
@arkms
arkms / SpriteToTexture.cs
Last active Nov 2, 2017
Guardar todos los sprites de una textura recortados dentro de la herramienta de Unity como imagenes separadas png para usarlo en otra herramienta
View SpriteToTexture.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.IO;
public class SpriteToTexture : EditorWindow
{
private Texture2D Atlas;