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 UnityEditor; | |
public class ConvertTextureToPng | |
{ | |
const string MenuName = "Assets/Save Texture to png"; | |
[MenuItem(MenuName)] | |
public static void SaveRTToFile() | |
{ |
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
// Modified from: http://wiki.unity3d.com/index.php/TextureScale#TextureScale.cs | |
// Only works on ARGB32, RGB24 and Alpha8 textures that are marked readable | |
using UnityEngine; | |
public class TextureScale { | |
private static Color[] texColors; | |
private static Color[] newColors; | |
private static int w; |
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) 2013 Calvin Rien | |
* | |
* Based on the JSON parser by Patrick van Bergen | |
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html | |
* | |
* Simplified it so that it doesn't throw exceptions | |
* and can be used in Unity iPhone with maximum code stripping. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining |
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
/** @param {Node|HTMLElement} node */ | |
function toJSON(node) { | |
if(!node) | |
node = this; | |
var obj = { nodeType: node.nodeType }; | |
if(node.tagName) | |
obj.tagName = node.tagName.toLowerCase(); | |
else if(node.nodeName) |