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
draw = GetComponent (typeof(IDrawable)) as IDrawable; |
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; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class SpawnFromTriangle : MonoBehaviour | |
{ | |
public Transform[] hanas; | |
public Triangle[] triangles; | |
public int numSpawn = 10; | |
public float emission = 10f; |
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
//http://gamedev.stackexchange.com/questions/59797/glsl-shader-change-hue-saturation-brightness | |
vec3 rgb2hsv(vec3 c) | |
{ | |
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); | |
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g)); | |
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r)); | |
float d = q.x - min(q.w, q.y); | |
float e = 1.0e-10; | |
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); |
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; | |
using System.Collections; | |
public class AfterEffects : MonoBehaviour { | |
public Material[] effectMats; | |
void OnRenderImage(RenderTexture s, RenderTexture d){ | |
RenderTexture rt = RenderTexture.GetTemporary(s.width, s.height); | |
Graphics.Blit(s, rt); |
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
<div class="bigStage"> | |
<div> | |
</div> | |
</div> | |
<p> | |
<a class="unityPlayer" href="UnityWeb.unity3d" target="_blank"> | |
<img alt="image" src="tumbnailUrl" width="width"/> | |
</a> | |
</p> |
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; | |
using System.Collections; | |
public class RandomOnMesh : MonoBehaviour { | |
void OnDrawGizmos(){ | |
Gizmos.color = Color.red; | |
for (int i = 0; i < 100; i++) { | |
Gizmos.DrawSphere( | |
GetRandomPointOnMesh(GetComponent<MeshFilter>().sharedMesh), | |
0.1f |
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 "Custom/ImageParticleEffect" { | |
Properties { | |
_MainTex ("Base (RGB)", 2D) = "white" {} | |
_SampTex ("sampler tex", 2D) = "white" {} | |
_WebTex ("webcam tex", 2D) = "black" {} | |
_Scale ("sq scale", Float) = 10 | |
_Size ("sq size", Float) = 1 | |
} | |
CGINCLUDE | |
#include "UnityCG.cginc" |
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; | |
using UnityEditor; | |
using System.Collections; | |
public class CreateMesh { | |
//16250枚Quadが入ったMeshを作る。 | |
[MenuItem("Custom/Create/16250meshes")] | |
public static void CreateParticleMesh(){ | |
Mesh mesh = new Mesh(); | |
int vertexCount = 65000; |
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
Mesh mesh = GetComponent<MeshFilter>().mesh; | |
Vector3 targetPoint; | |
Vector3[] vertices = mesh.vertices; | |
float power; //吸い込まれ力 | |
for(int i = 0; i < vertices.Length; i++){ | |
//ここら変の計算を変えて、吸い込まれ方を調整 | |
float d = (vertices[i] - targetPoint).sqrMagnitude; | |
vertices[i] += (vertices[i] - targetPoint)*Time.deltaTime*d*power; | |
} |
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 "AngryBots/Particle/AlphaBlend" { | |
Properties { | |
_MainTex ("Base", 2D) = "white" {} | |
_TintColor ("TintColor", Color) = (1.0, 1.0, 1.0, 1.0) | |
} | |
CGINCLUDE | |
#include "UnityCG.cginc" |