This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
public sealed class CustomModelImporter : AssetPostprocessor | |
{ | |
void OnPreprocessModel() | |
{ | |
var importer = assetImporter as ModelImporter; | |
importer.importNormals = ModelImporterNormals.Calculate; | |
importer.materialLocation = ModelImporterMaterialLocation.External; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
using UnityEngine; | |
using System.Collections.Generic; | |
using System.IO; | |
public class PrefabCreator : EditorWindow | |
{ | |
const string MenuPath = "Assets/Create/CreatePrefab #\\"; | |
readonly static string[] ColliderName = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class BaseState | |
{ | |
public virtual BaseState Update() | |
{ | |
return null; | |
} | |
} | |
public class IdleState : BaseState | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class Main : MonoBehaviour | |
{ | |
enum State | |
{ | |
Idle, Move | |
}; | |
State state; | |
void Start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "Unlit/UI_Gauge" | |
{ | |
Properties | |
{ | |
_ColorTex ("Color Texture", 2D) = "white" {} | |
_GaugeTex("GaugeTexture", 2D) = "white"{} | |
_Threshold("Threshold", Range(0, 1)) = 0 | |
_Offset("Offset", Float) = -0.05 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float Remap(float input, float2 inMinMax, float2 outMinMax) | |
{ | |
float inMinMaxDiff = inMinMax.y - inMinMax.x; | |
float outMinMaxDiff = outMinMax.y - outMinMax.x; | |
return outMinMax.x + (input - inMinMax.x) * outMinMaxDiff / inMinMaxDiff; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float2 TranslateSt(float2 st, float2 pos) | |
{ | |
float3x3 mat = float3x3( | |
1, 0, pos.x, | |
0, 1, pos.y, | |
0, 0, 1); | |
st -= 0.5; | |
st = mul(mat, float3(st, 1)); | |
st += 0.5; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class Bullet : MonoBehaviour | |
{ | |
float force = 1.0f; | |
float currentTime = 0.0f; | |
float sleeptime = 1.0f; | |
public void Initialize(Transform transform) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "CustomParticleShader" | |
{ | |
Properties | |
{ | |
_Color ("Color", Color) = (1,1,1,1) | |
_MainTex ("Albedo (RGB)", 2D) = "white" {} | |
} | |
SubShader | |
{ | |
Tags{ "RenderType" = "Transparent" "Queue" = "Transparent" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class FXAttributeChanger : MonoBehaviour | |
{ | |
PKFxFX fx; | |
void Start() | |
{ | |
fx = GetComponent<PKFxFX>(); | |
} |