Shader "MaterialPropertyDrawer"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
[HideInInspector] _MainTex2("Hide Texture", 2D) = "white" {}
This file contains 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
// show the field as a read only label (runtime script) | |
[AttributeUsage(AttributeTargets.Field)] | |
public class ReadOnlyAttribute : PropertyAttribute { } | |
// read only drawer (editor script) | |
[CustomPropertyDrawer(typeof (ReadOnlyAttribute))] | |
public class ReadOnlyAttributeDrawer : PropertyDrawer | |
{ | |
private static readonly GUIStyle Style = EditorStyles.label; |
This file contains 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
[MenuItem(ItemNamePrefix + "Convert Font")] | |
public static void ConvertFont() | |
{ | |
var sb = new StringBuilder(); | |
var objs = AssetDatabase.LoadAllAssetsAtPath("Assets/Amstrad/AmstradFont.psd"); | |
var sprites = objs.OfType<Sprite>().OrderBy(s => CalcIndex(s.name)).ToArray(); | |
foreach (var sprite in sprites) | |
{ | |
sb.AppendLine("name " + sprite.name); | |
sb.AppendLine("rect " + sprite.rect); |
This file contains 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
program roman(output); | |
var | |
x, y : integer; | |
begin y := 1; | |
repeat x := y; write(x:12, ' '); | |
while x >= 1000 do | |
begin write('m'); x := x - 1000 end; | |
if x >= 500 then | |
begin write('d'); x := x - 500 end; | |
while x >= 100 do |