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 / 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;
}
@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;
View SpawnerWithAssetReference.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AddressableAssets;
public class SpawnerWithAssetReference : MonoBehaviour
{
[SerializeField] AssetReferenceGameObject obj;
void Awake()
@tsubaki
tsubaki / ItemGetSystem.cs
Created Apr 25, 2019
Unity Physicsの使用例
View ItemGetSystem.cs
using Unity.Entities;
using Unity.Physics.Systems;
[UpdateAfter(typeof(StepPhysicsWorld))]
public class ItemGetSystem: ComponentSystem
{
private BuildPhysicsWorld buildPhysicsWorldSystem;
private StepPhysicsWorld stepPhysicsWorldSystem;
protected override void OnCreate()
View CopyTransformToGameObjectConvert.cs
using Unity.Entities;
using Unity.Transforms;
using UnityEngine;
public class CopyTransformToGameObjectConvert : MonoBehaviour, IConvertGameObjectToEntity
{
public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
{
dstManager.AddComponentData(entity, new CopyTransformToGameObject());
}
View HitTestSystem.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Unity.Physics;
using Unity.Mathematics;
using Unity.Transforms;
using Unity.Entities;
using Unity.Physics.Systems;
[AlwaysUpdateSystem]
You can’t perform that action at this time.