Skip to content

Instantly share code, notes, and snippets.

Avatar

ohbashunsuke baobao

View GitHub Profile
View helloworld.asm
; global シンボル名で公開したいシンボルを定義(外部から参照可能になる)
global _main
; DATAセクションの始まりを定義
section .data
; str_helloというラベルを定義(あとから参照できるようにする)
; db 文字列で、指定文字列をASCIIコードに変換して数値として連続して書き込むということを意味する
; db "H","e","l","l","o", " World", 0x0a と記述しても同じ
; 0x0aは改行の意味
@baobao
baobao / Main.cs
Last active Feb 18, 2022
イントロ実装SoundManager
View Main.cs
using UnityEngine;
using System.Collections;
public class Main : MonoBehaviour
{
public AudioClip clip;
private SoundManager _mng;
void Start ()
{
@baobao
baobao / UIToolkit_MouseDownUpTest.cs
Last active Jan 29, 2022
UI Toolkitサンプル:MouseDown・MouseUpショートコード
View UIToolkit_MouseDownUpTest.cs
using UnityEngine;
using UnityEngine.UIElements;
// 解説Qiita記事 : https://qiita.com/ohbashunsuke/items/ae1da96e582aef734eee
[RequireComponent(typeof(UIDocument))]
public class UIToolkit_MouseDownUpTest : MonoBehaviour
{
void OnEnable()
{
var document = GetComponent<UIDocument>();
View UI-Mask.shader
Shader "UI/Mask"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
View DynamicCreateMesh_3.cs
using UnityEngine;
[RequireComponent (typeof(MeshRenderer))]
[RequireComponent (typeof(MeshFilter))]
public class DynamicCreateMesh : MonoBehaviour
{
[SerializeField] Material _colorMaterial;
private void Start ()
{
View DynamicCreateMesh.cs
using UnityEngine;
[RequireComponent (typeof(MeshRenderer))]
[RequireComponent (typeof(MeshFilter))]
public class DynamicCreateMesh : MonoBehaviour
{
[SerializeField] Material _colorMaterial;
private void Start ()
{
View ShadowMap.cs
using UnityEngine;
[ExecuteInEditMode]
public class ShadowMap : MonoBehaviour
{
[SerializeField]
Material m_mat;
void OnWillRenderObject ()
{
@baobao
baobao / CreateQRCodeWindow.cs
Last active Sep 16, 2021
QR Code Creator EditorWindow
View CreateQRCodeWindow.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.IO;
/// <summary>
/// QRコード作成EditorWindow
/// </summary>
public class CreateQRCodeWindow : EditorWindow
@baobao
baobao / AnimationClipRecoveryEditor.cs
Last active Aug 22, 2021
アニメーションクリップを少しリカバリーするEditorスクリプト
View AnimationClipRecoveryEditor.cs
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
public class AnimationClipRecoveryEditor : EditorWindow
{
[MenuItem("Tools/AnimationClip Recover")]
static void Init ()
{
@baobao
baobao / CustomPivot.cs
Last active Aug 9, 2021
【Unity】Sprite PivotをCustomに設定するサンプルコード
View CustomPivot.cs
using UnityEditor;
using UnityEngine;
/// <summary>
/// Sprite PivotをCustomに設定するサンプルコード
/// </summary>
public class CustomPivot : AssetPostprocessor
{
private void OnPostprocessTexture(Texture2D target)
{