Skip to content

Instantly share code, notes, and snippets.

View TheStoneBook's full-sized avatar

Shunsuke_Ishimoto TheStoneBook

View GitHub Profile
@TheStoneBook
TheStoneBook / ArrayShuffleTest.cs
Last active June 23, 2018 18:42
【Unity】配列のシャッフル
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ArrayShuffleTest : MonoBehaviour {
public GameObject[] Object;
void Start () {
@TheStoneBook
TheStoneBook / EndSECallBack.cs
Last active June 25, 2018 14:35
【Unity】SEの終了を知らせるコールバック
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EndSECallBack : MonoBehaviour {
private AudioSource SE;
void Start () {
@TheStoneBook
TheStoneBook / TouchEventTest.cs
Last active June 25, 2018 14:37
【Unity】EventSystemを使ったタッチイベントの取得
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class TouchEventTest : MonoBehaviour, IPointerDownHandler {
public void OnPointerDown(PointerEventData data){
//ここに処理を書く。
Debug.Log ("タッチしたよー!");
@TheStoneBook
TheStoneBook / ShuffleUseGuid.cs
Last active June 30, 2018 13:51
【Unity】GUIDを使って配列をシャッフルする。
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Linq;
using System;
public class ShuffleUseGuid : MonoBehaviour {
public GameObject[] Object;
@TheStoneBook
TheStoneBook / GuidSample.cs
Created July 1, 2018 16:46
【Unity】指定アセットファイルのGUIDを取得する。
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using UnityEditor;
public class GuidSample : MonoBehaviour {
void Start () {
string t = AssetDatabase.AssetPathToGUID ("Assets/FileName");
@TheStoneBook
TheStoneBook / DragEventTest.cs
Last active July 1, 2018 16:54
【Unity】ドラッグでオブジェクトを動かす【EventSystem】
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
//CameraのProjectionはOrthographicに。
public class DragEventTest : MonoBehaviour,IDragHandler {
public void OnDrag(PointerEventData data){
Vector3 TargetPos = Camera.main.ScreenToWorldPoint (data.position);
@TheStoneBook
TheStoneBook / Collider2DOverlapTest.cs
Last active July 6, 2018 18:59
【Unity】ドラッグで動かしてるCollider2Dと指定のCollider2Dが重なってるかどうかを取得するテスト
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class Collider2DOverlapTest : MonoBehaviour,IDragHandler {
[SerializeField]
private GameObject EnteredObject;
@TheStoneBook
TheStoneBook / BoundsContainsTest.cs
Last active July 6, 2018 19:00
【Unity】Bounds.Containsのテスト
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class BoundsContainsTest : MonoBehaviour,IDragHandler {
[SerializeField]
private GameObject EnteredObject;
@TheStoneBook
TheStoneBook / DecalCustom.shader
Created July 15, 2018 18:31
【Unity】2枚のテクスチャを重ねるシェーダー
Shader "Unlit/DecalCustom"
{
Properties
{
_MainTex ("MainTex", 2D) = "white" {}
_SubTex("SubTex",2D)="white"{}
}
SubShader
{
Tags { "RenderType"="Opaque"
@TheStoneBook
TheStoneBook / TestImage.png.meta
Last active July 22, 2018 19:38
【Unity】画像ファイルのmetaファイル
fileFormatVersion: 2
guid: f2f994c0d0f9b4a24b4c4615306b56ef
timeCreated: 1532129949
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0