Instantly share code, notes, and snippets.

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

arkms

View GitHub Profile
View DebugLogEmail.cs
using System.Collections;
using System.Text;
using UnityEngine;
public class DebugLogEmail : MonoBehaviour
{
//Llamar desde un boton o presionar una tecla para enviar los logs por email
public void MandarEmail()
{
StartCoroutine(SendData());
View CombineTexture.cs
Texture2D CombineTexutes(Texture2D _textureA, Texture2D _textureB)
{
//Create new textures
Texture2D textureResult = new Texture2D(_textureA.width, _textureA.height);
//create clone form texture
textureResult.SetPixels(_textureA.GetPixels());
//Now copy texture B in texutre A
for (int x = 0; x<_textureB.width; x++)
{
for (int y = 0; y<_textureB.height; y++)
View TextureToNormalmap.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//Basado en: https://forum.unity.com/threads/bumpmap-grayscale-to-normalmap-rgb.5714/
public class TextureToNormalmap : MonoBehaviour
{
//---CODIGO DE EJEMPLO------------------------------
public Texture2D textura;
[Range(10f, 20f)]
View UI_HoldButton.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
public class UI_HoldButton : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
{
public UnityEvent OnHold;
View SpriteToTexture.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.IO;
public class SpriteToTexture : EditorWindow
{
private Texture2D Atlas;
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'
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;
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);
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
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());
}