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
View AssetBundleNameLinkXMLGenerator.cs
using UnityEditor;
using UnityEngine;
public class AssetBundleChecker
{
[MenuItem("Assets/CreateLink.xml")]
static void Create()
{
var generator = new LinkXmlGenerator();
// UnityEditor.Animations.AnimatorControllerを取得してしまうので、RuntimeAnimatorControllerに変更
@tsubaki
tsubaki / ClickToEndBehaviour.cs
Last active Nov 13, 2019
UnityのTimel inで、クリックしたらクリップの末まで移動する
View ClickToEndBehaviour.cs
using UnityEngine;
using UnityEngine.Playables;
public class ClickToEndBehaviour : PlayableBehaviour
{
private PlayableDirector director { get; set; }
public override void OnPlayableCreate(Playable playable)
{
director = (playable.GetGraph().GetResolver() as PlayableDirector);
@tsubaki
tsubaki / NotchPadding.cs
Created Oct 30, 2019
縦のノッチ一つ前提、ノッチの位置で安全マージンを設定する
View NotchPadding.cs
using UnityEngine;
[ExecuteAlways]
public class NotchPadding : MonoBehaviour
{
[SerializeField] RectTransform left, right;
void Update()
{
if (Screen.cutouts == null || Screen.cutouts[0] == null || left == null || right == null)
View SetSafeArea.cs
using UnityEngine;
[RequireComponent(typeof(RectTransform))]
[ExecuteAlways]
public class SafeAreaPadding : MonoBehaviour
{
private DeviceOrientation postOrientation;
void Update()
{
View MyComponent.cs
using System.Collections.Generic;
using UnityEngine;
public class MyComponent : MonoBehaviour
{
[SerializeReference] List<IMyInterface> dataarray = new List<IMyInterface>();
void Start()
{
foreach( var item in dataarray)
@tsubaki
tsubaki / LookAtCleanupSystem.cs
Last active Oct 22, 2019
ISystemStateComponentData及びISystemStateBufferElementDataの使用例
View LookAtCleanupSystem.cs
using Unity.Collections;
using Unity.Entities;
using Unity.Transforms;
using static Unity.Entities.ComponentType;
public struct LookAtInitialized : ISystemStateComponentData
{
public Entity Value;
}
View SkinnedMeshUpdater.cs
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.Assertions;
using System;
public class SkinnedMeshUpdater : MonoBehaviour
{
[SerializeField]
SkinnedMeshRenderer original;
@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をプレハブに変換する。
You can’t perform that action at this time.