Skip to content

Instantly share code, notes, and snippets.

View pillar's full-sized avatar

pillar pillar

  • home
  • Guangzhou, China
View GitHub Profile
@pillar
pillar / gist:dbda67fd61b98fb13be8ffed98646f79
Created July 25, 2017 06:57 — forked from kankikuchi/gist:7499555
Unity Character Controller 移動
public float walkSpeed = 7.0f; //歩く速度
public float gravity = 10.0f;//重力加速度
private Vector3 velocity;//現在の速度
void Update () {
//CharacterControllerを取得
CharacterController controller = GetComponent<CharacterController>();
@pillar
pillar / LayerBlur.js
Created October 19, 2016 03:02 — forked from mutoo/LayerBlur.js
blurred-modal-background-in-cocos2d-js
var LayerBlur = cc.Layer.extend({
ctor: function (blurRadius, maskColor) {
this._super();
// create shader program
var program = cc.GLProgram.create(res.blur_vsh, res.blur_fsh);
program.addAttribute(cc.ATTRIBUTE_NAME_POSITION, cc.VERTEX_ATTRIB_POSITION);
program.addAttribute(cc.ATTRIBUTE_NAME_COLOR, cc.VERTEX_ATTRIB_COLOR);
program.addAttribute(cc.ATTRIBUTE_NAME_TEX_COORD, cc.VERTEX_ATTRIB_TEX_COORDS);
program.link();
@pillar
pillar / gist:fb3746b623c483dd2a9631fcf8e46f1b
Created September 19, 2016 03:49 — forked from mrdoob/gist:951956
Create RGB image (A replacing B channel) out of RGBA image.
from PIL import Image
import glob, os
for infile in glob.glob( "*.png" ):
file, ext = os.path.splitext( infile )
im = Image.open( infile )
im.load()
r, g, b, a = im.split()
@pillar
pillar / ExecutionOrderManager.cs
Created May 19, 2016 03:48 — forked from Skybladev2/ExecutionOrderManager.cs
Explicit script exection order for Unity scripts
using System;
using UnityEditor;
[InitializeOnLoad]
public class ExecutionOrderManager : Editor
{
static ExecutionOrderManager()
{
foreach (MonoScript monoScript in MonoImporter.GetAllRuntimeMonoScripts())
{
@pillar
pillar / QuadTreeTest.cs
Created May 19, 2016 03:39 — forked from DGoodayle/QuadTreeTest.cs
Quadtree in Unity
using UnityEngine;
using System.Collections;
public class QuadTreeTest : MonoBehaviour {
public class TestObject : IQuadTreeObject{
private Vector3 m_vPosition;
public TestObject(Vector3 position){
m_vPosition = position;
}
public Vector2 GetPosition(){
using UnityEngine.EventSystems;
namespace UnityEngine.UI
{
[RequireComponent (typeof (Canvas))]
[ExecuteInEditMode]
[AddComponentMenu("Layout/Reference Resolution", 101)]
public class ReferenceResolution : UIBehaviour
{
@pillar
pillar / RadialLayout.cs
Last active September 19, 2015 18:44 — forked from DGoodayle/RadialLayout.cs
Radial Layouts in Unity
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
@pillar
pillar / boost.sh
Created February 13, 2014 03:11 — forked from pa-zz-yco/boost.sh
#===============================================================================
# Filename: boost.sh
# Author: Pete Goodliffe
# Copyright: (c) Copyright 2009 Pete Goodliffe
# Licence: Please feel free to use this, with attribution
# Modified version
#===============================================================================
#
# Builds a Boost framework for the iPhone.
# Creates a set of universal libraries that can be used on an iPhone and in the