Skip to content

Instantly share code, notes, and snippets.

Tatsuhiko Yamamura tsubaki

Block or report user

Report or block tsubaki

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tsubaki
tsubaki / NotificationObject.cs
Last active Oct 9, 2019
値の変更を通知するオブジェクト。基本型のみ可能っぽい。要4.5
View NotificationObject.cs
using UnityEngine;
using System.Collections;
using System;
[System.Serializable]
public class NotificationObject<T>
{
public delegate void NotificationAction (T t);
private T data;
@tsubaki
tsubaki / GameObjectEntityCleanUpSystem.cs
Last active Oct 8, 2019
GameObjectとEntityを連携する
View GameObjectEntityCleanUpSystem.cs
using Unity.Collections;
using Unity.Entities;
using Unity.Transforms;
using System.Collections.Generic;
using UnityEngine;
[UpdateInGroup(typeof(GameObjectAfterConversionGroup))]
public class GameObjectEntityCleanUpSystem : ComponentSystem
{
private EntityQuery query;
@tsubaki
tsubaki / ScriptableObjectToAsset.cs
Last active Sep 30, 2019
ScriptableObjectをAssetsファイルとして出力する汎用スクリプト
View ScriptableObjectToAsset.cs
using UnityEngine;
using System.Collections;
using UnityEditor;
using System.IO;
/// <summary>
// ScriptableObjectをプレハブとして出力する汎用スクリプト
/// </summary>
// <remarks>
// 指定したScriptableObjectをプレハブに変換する。
@tsubaki
tsubaki / SetVolumes.cs
Created May 23, 2015
Unity5のグループに対するオーディオの設定
View SetVolumes.cs
using UnityEngine;
using System.Collections;
public class SetVolumes : MonoBehaviour {
[SerializeField]
UnityEngine.Audio.AudioMixer mixer;
public float masterVolume
{
@tsubaki
tsubaki / Click2Fade.cs
Last active Sep 4, 2019
StandardShaderの描画をFadeにする
View Click2Fade.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Collider))]
[RequireComponent(typeof(Renderer))]
public class Click2Fade : MonoBehaviour
{
// フェードにかかる時間
[SerializeField, Range(0.1f, 0.3f)]
View Story1.cs
using System.Collections;
using UnityEngine;
using UnityEngine.U2D;
public class Story1 : MonoBehaviour
{
[SerializeField]UnityEngine.UI.Text textbox;
[SerializeField]SpriteRenderer body, face;
[SerializeField] SpriteAtlas atlas;
View Story1.cs
using System.Collections;
using UnityEngine;
public class Story1 : MonoBehaviour
{
IEnumerator Start ()
{
Debug.Log("衝撃のファーストブリット");
yield return new WaitUntil(()=>Input.GetMouseButtonDown(0));
yield return null;
@tsubaki
tsubaki / TextController.cs
Created Dec 6, 2014
超簡単なテキスト制御3
View TextController.cs
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class TextController : MonoBehaviour
{
public string[] scenarios;
[SerializeField] Text uiText;
[SerializeField][Range(0.001f, 0.3f)]
@tsubaki
tsubaki / JsonSplitSprite.cs
Last active Aug 20, 2019
Json(exported with texture packer) -> unity 2d Multiple sprite . (request minijson https://gist.github.com/darktable/1411710)
View JsonSplitSprite.cs
// --
// The MIT License
//
// Copyright (c) 2013 tatsuhiko yamamura
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
@tsubaki
tsubaki / ExportSprites.cs
Last active Aug 18, 2019
Load Multiple Sprite with scriptableObject
View ExportSprites.cs
using UnityEngine;
using System.Collections;
using UnityEditor;
public class ExportSprites {
[MenuItem("Assets/Create/SpriteScriptableObject")]
static void Export()
{
foreach (var sprite in Selection.objects) {
You can’t perform that action at this time.