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
| Shader "Custom/Snow" { | |
| Properties { | |
| _Color ("Color", Color) = (1,1,1,1) | |
| _MainTex ("Albedo (RGB)", 2D) = "white" {} | |
| _Glossiness ("Smoothness", Range(0,1)) = 0.5 | |
| _Metallic ("Metallic", Range(0,1)) = 0.0 | |
| _Snow("Snow", Range(0,2))= 0.0 | |
| } | |
| SubShader { | |
| Tags { } |
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
| void OnParticleCollision(GameObject objct){ | |
| //衝突したオブジェクトタグがenemyだった場合、オブジェクトを破壊する | |
| if(obj.gameObject.tag == "enemy"){ | |
| Object.Destroy(gameObject); | |
| } | |
| } |
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
| public class Hoge : MonoBehaviour | |
| { | |
| private int _frame = 0; | |
| // Use this for initialization | |
| void Start () | |
| { | |
| } | |
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
| 1.現在のシーン名を判定 | |
| if(Application.loadedLevelName == "main"){ | |
| scene = true; | |
| }else{ | |
| scene = false; | |
| } | |
| 2.回転させる | |
| this.transform.Rotate (new Vector3 (0, 0, 5 * Time.deltaTime)); |
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
| public GameObject[] Num_spline = new GameObject[10]; | |
| public bool parchk=true; | |
| void Start () { | |
| } | |
| void Update () { | |
| if (Input.GetMouseButtonDown(0)) { |
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
| // ボタンの設定 | |
| function OnGUI () { | |
| // バッググラウンドと名前設定 | |
| GUI.Box (Rect (10,10,100,90), "メニュー"); | |
| // ボタンの位置と名前設定 | |
| if (GUI.Button (Rect (20,40,80,20), "Script ON")) { | |
| // ボタン押した時に実行したいもの | |
| GetComponent(スクリプト名).enabled = true; | |
| } | |
| if (GUI.Button (Rect (20,70,80,20), "Script OFF")) { |
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
| Shader "DoubleSide" { | |
| Properties { | |
| _Color ("Main Color", Color) = (1,1,1,1) | |
| _MainTex ("Base (RGB)", 2D) = "white" {} | |
| } | |
| SubShader { | |
| Tags { "RenderType"="Opaque" } | |
| LOD 200 | |
| Cull off | |
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
| // 現在時刻の取得 | |
| System.DateTime now = System.DateTime.Now; | |
| int nowMonth; | |
| int nowDay; | |
| now = System.DateTime.Now; | |
| nowMonth = now.Month; | |
| nowDay = now.Day; |
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
| transform.Rotate(X * Time.deltaTime, Y * Time.deltaTime, Z * Time.deltaTime); |
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
| // 左クリックしたオブジェクトを取得する関数(3D) | |
| public GameObject getClickObject() { | |
| GameObject result = null; | |
| // 左クリックされた場所のオブジェクトを取得 | |
| if(Input.GetMouseButtonDown(0)) { | |
| Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); | |
| RaycastHit hit = new RaycastHit(); | |
| if (Physics.Raycast(ray, out hit)){ | |
| result = hit.collider.gameObject; | |
| } |