Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
namespace UnityEngine.UI{
public class MyText : Text{
#if UNITY_EDITOR
using UnityEngine;
using UnityEngine.UI;
using UnityEditor;
// Assets/Editorに置く
public class UIExtension {
// Textのフォントなどの設定
[MenuItem ("Tools/UI/SetText")]
s = "山賀琴子ことこ"
output = ""
140.times{
index = rand(s.length)
add_s = s[index]
output = output + add_s
}
@peroon
peroon / Unlit-CastShadow.shader
Created November 16, 2016 13:52 — forked from pigeon6/Unlit-CastShadow.shader
Unlit texture shader which casts shadow on Forward/Defered
// Unlit texture shader which casts shadow on Forward/Defered
Shader "Unlit/Texture CastShadow" {
Properties {
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
}
SubShader {
Tags {"Queue"="Opaque" }
LOD 100
using UnityEngine;
using UnityEditor;
using UnityEngine.UI;
using System.Collections;
using DL;
// Textで作っちゃってDLTextに移行するのが面倒なときに使う
public class TextToDLText {
using UnityEngine;
using System;
using System.Linq;
using System.Collections.Generic;
namespace DL
{
/// <summary>
/// MonoBehaviourの拡張クラス
/// </summary>
def fizzbuzz(n):
for i in range(1, n+1):
if i % 15 == 0:
print "FizzBuzz"
elif i % 3 == 0:
print "Fizz"
elif i % 5 == 0:
print "Buzz"
else:
print i
class Person:
def __init__(self,initialAge):
# Add some more code to run some checks on initialAge
if initialAge < 0:
print "Age is not valid, setting age to 0."
self.age = 0
else:
self.age = initialAge
def amIOld(self):
# Do some computations in here and print out the correct statement to the console
# 二進数にする
n = 15
binary_s = format(n, 'b')
binary_s = "11000001111010"
print binary_s
print len(binary_s)
from itertools import groupby
def count_continuous(s):
len_list = []
c = [1,2,3]
import pickle
f = open("sample.pickle", "w")
pickle.dump(c, f)
f.close()
print "load from pickle"
f = open("sample.pickle", "r")
d = pickle.load(f)