Skip to content

Instantly share code, notes, and snippets.

using UnityEngine;
public class FXAttributeChanger : MonoBehaviour
{
PKFxFX fx;
void Start()
{
fx = GetComponent<PKFxFX>();
}
Shader "CustomParticleShader"
{
Properties
{
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
}
SubShader
{
Tags{ "RenderType" = "Transparent" "Queue" = "Transparent" }
using UnityEngine;
public class Bullet : MonoBehaviour
{
float force = 1.0f;
float currentTime = 0.0f;
float sleeptime = 1.0f;
public void Initialize(Transform transform)
{
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;
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;
}
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
using UnityEngine;
public class Main : MonoBehaviour
{
enum State
{
Idle, Move
};
State state;
void Start()
public abstract class BaseState
{
public virtual BaseState Update()
{
return null;
}
}
public class IdleState : BaseState
{
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 =
using UnityEditor;
public sealed class CustomModelImporter : AssetPostprocessor
{
void OnPreprocessModel()
{
var importer = assetImporter as ModelImporter;
importer.importNormals = ModelImporterNormals.Calculate;
importer.materialLocation = ModelImporterMaterialLocation.External;