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 System; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| using UnityEditor; | |
| namespace UnityEngine.UI{ | |
| public class MyText : Text{ | |
| #if UNITY_EDITOR |
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 UnityEngine.UI; | |
| using UnityEditor; | |
| // Assets/Editorに置く | |
| public class UIExtension { | |
| // Textのフォントなどの設定 | |
| [MenuItem ("Tools/UI/SetText")] |
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
| s = "山賀琴子ことこ" | |
| output = "" | |
| 140.times{ | |
| index = rand(s.length) | |
| add_s = s[index] | |
| output = output + add_s | |
| } |
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
| // 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 |
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; | |
| using UnityEngine.UI; | |
| using System.Collections; | |
| using DL; | |
| // Textで作っちゃってDLTextに移行するのが面倒なときに使う | |
| public class TextToDLText { |
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 System; | |
| using System.Linq; | |
| using System.Collections.Generic; | |
| namespace DL | |
| { | |
| /// <summary> | |
| /// MonoBehaviourの拡張クラス | |
| /// </summary> |
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
| 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 |
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
| 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 |
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
| # 二進数にする | |
| 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 = [] |
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
| 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) |