Skip to content

Instantly share code, notes, and snippets.

@Mesidin
Mesidin / LoadABScene.cs
Last active September 19, 2015 07:07 — forked from tsubaki/LoadABScene.cs
AssetBundleからシーンを読む
using UnityEngine;
using System.Collections;
public class LoadABScene : MonoBehaviour {
[SerializeField] string sceneName = "Demo";
[SerializeField] string assetBundleName = "demo";
IEnumerator Start()
{
@Mesidin
Mesidin / LightmapPrefab.cs
Last active September 19, 2015 07:06 — forked from tsubaki/LightmapPrefab.cs
PrefabにLightmapを適応する
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
public class LightmapPrefab : MonoBehaviour {
[System.Serializable]
class LightmapParameter
{
public int lightmapIndex = -1;
@Mesidin
Mesidin / Ghost.shader
Last active September 19, 2015 07:06 — forked from tsubaki/Ghost.shader
ghost shader
Shader "FX/Ghost" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_NormalTex ("Normal (RGB)", 2D) = "white" {}
_EmissionTex ("Emission (RGB)", 2D) = "white" {}
_Glossiness ("Smoothness", Range(0,1)) = 0.5
_Metallic ("Metallic", Range(0,1)) = 0.0
_Blightness ("Metallic", Range(0,3)) = 0.0
}
@Mesidin
Mesidin / surface_two_pass.shader
Last active September 19, 2015 07:06 — forked from tsubaki/surface_two_pass.shader
surface shader2パス
Shader "surface_two_pass" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
}
SubShader {
// 1パス目
Tags {"Queue"="Transparent"}
CGPROGRAM
ENDCG
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
public class CopyComponents : EditorWindow {
private GameObject originalObject = null;
private GameObject targetObject = null;
[MenuItem("Window/CopyComponent")]
@Mesidin
Mesidin / TwoPass.shader
Last active September 19, 2015 07:06 — forked from tsubaki/TwoPass.shader
2パス描画のサンプル
Shader "Custom/TwoPass" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_Glossiness ("Smoothness", Range(0,1)) = 0.5
_Metallic ("Metallic", Range(0,1)) = 0.0
}
SubShader {
// ----- 1 pass ------
@Mesidin
Mesidin / RadialLayout.cs
Last active September 14, 2015 19:45 — forked from anonymous/RadialLayout.cs
Radial Layouts within Unity3Ds UI system
using UnityEngine;
using UnityEngine.UI;
/*
Radial Layout Group by Just a Pixel (Danny Goodayle) - http://www.justapixel.co.uk
Copyright (c) 2015
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
@Mesidin
Mesidin / Damage.cs
Last active January 14, 2023 06:48
Unity Re-usable Stat System
namespace MinionStudios
{
[System.Serializable]
public class Damage
{
public enum Type { Standard, Fire, Bludgeon, Poison, Stun, Heal, Fall };
public Type type;
public float initialDamage = 1f;
public float damagePerSecond = .5f;
public float expireSeconds = 0.0f;
using UnityEngine;
using System.Collections;
//You must add the following Components to the object or else this script will fail.
[RequireComponent(typeof(Rigidbody))]
[RequireComponent(typeof(CapsuleCollider))]
[RequireComponent(typeof(Animator))]
//Provides a set of default values to instance and build on top of.
public class Movement{
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
public abstract class BaseModel<T> where T : BaseModel<T>
{
private static bool SHOW_DEBUGGING_MESSAGES = false;