Skip to content

Instantly share code, notes, and snippets.

@peroon
peroon / gist:ffe032de2c1c013dab07
Created June 18, 2015 06:45
UIを左右に揺らす。ダメージ表現によさそう
this.GetComponent<RectTransform> ().DOPunchPosition (Vector3.right * 100, 1.0f);
@peroon
peroon / gist:bf215c73bc9da2470759
Last active August 29, 2015 14:23
DOTween 横にスケールしながら縦は0スケールで消える演出
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
public class DOTweenText : MonoBehaviour {
void Start () {
// stretch vertically
@peroon
peroon / gist:f3c9e900a079626052ef
Created June 18, 2015 08:14
#unity ScriptableObjectをpublic変数で宣言して付けたり、Resources.Loadしたりできる
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;
public class Manager : MonoBehaviour {
public NetworkData networkData;
void Start () {
@peroon
peroon / gist:4d316129f8264a5e897b
Created June 29, 2015 08:05
[Unity]Take ScreenShot of GameView and assign it as material texture
using UnityEngine;
using System.Collections;
using System.IO;
public class Temp : MonoBehaviour {
void Start () {
StartCoroutine (this.TakeScreenShot ());
}
@peroon
peroon / gist:16edb2135f152d6eb4b9
Last active August 29, 2015 14:24
Parse.com + Unityサンプル
// AssetStore's parse asset doesn't work.
// SDK page sample project works.
using UnityEngine;
using System.Collections;
using Parse;
public class ParseTest : MonoBehaviour {
public void OnClickSend(){
@peroon
peroon / gist:d20d685e7fcd8fdf4caf
Created August 14, 2015 19:28
Unity Inspector 整理
// 結果
[System.Serializable]
public class Result{
public GameObject successPanel;
public GameObject failPanel;
}
public Result result;
Applications/Unity/Unity.app/Contents/Resources/ScriptTemplates
@peroon
peroon / BaseVertexEffect.cs
Created November 8, 2015 03:58
BaseVertexEffect.cs
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using DG.Tweening;
using System.Collections.Generic;
public class PuniconView : BaseVertexEffect {
void Start () {
@peroon
peroon / 動画作成コード ffmpeg.rb
Last active November 13, 2015 07:43
動画作成コード ffmpeg.rb
Dir.chdir("VR_Sequence")
def ffmpeg(start_frame, end_frame)
vframe = end_frame - start_frame - 1
direction = "ffmpeg -f image2 -r 60 -start_number #{start_frame} -i img%05d.png -vframes #{vframe} -r 60 -an -vcodec libx264 -y -pix_fmt yuv420p #{start_frame}-#{end_frame}.mp4"
p direction
system(direction)
end
startf = 4; endf = startf + 6000 - 1
@peroon
peroon / rigidbodyをコードで変更する時はフラグ切り替えを挟む必要がある.cs
Last active November 13, 2015 07:52
rigidbodyをコードで変更する時はフラグ切り替えを挟む必要がある.cs
if (rigidbody) {
rigidbody.isKinematic = true;
rigidbody.velocity = velocity;
rigidbody.useGravity = useGravity;
rigidbody.isKinematic = false;
}