Skip to content

Instantly share code, notes, and snippets.

using UnityEngine;
using System.Collections;
public class CharacterLocomotion : MonoBehaviour
{
Animator anim;
float verticalSpeed = 0.0f;
bool isOnGround = false;
using UnityEngine;
using System.Collections;
using UnityEngine.EventSystems;
public static class GameObjectExtension
{
public static GameObject InstantiateAsChild(this Transform self, GameObject prefab)
{
return self.InstantiateAsChild(prefab, Vector3.zero, Quaternion.identity);
}
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Diagnostics;
public class InstallAndRun : EditorWindow
{
[MenuItem("Android/Install and Run")]
public static void DoInstallAndRun()
{
@kuriharaan
kuriharaan / ForbidWalk.cs
Created July 17, 2015 06:09
Sample for StateMachineBehaviour
using UnityEngine;
using System.Collections;
public class ForbidWalk : StateMachineBehaviour {
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
animator.SetBool("CanWalk", false);
}
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class FiniteStateMachine<S>
{
protected S m_state;
protected S m_prevState;
@kuriharaan
kuriharaan / PngResize.cpp
Last active December 10, 2015 07:58
アルファつきPNGをスケールして出力する。 スケール後の画像を8の倍数サイズにしたい場合など、padding_sizeで指定することで透明領域を追加する。 opencv2.4.3使用。
// PictureResize.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//
#include "stdafx.h"
#include <iostream>
#include <windows.h>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>