Skip to content

Instantly share code, notes, and snippets.

View kazumalab's full-sized avatar
🦁
I may be slow to respond.

Kazuma kazumalab

🦁
I may be slow to respond.
View GitHub Profile
@kazumalab
kazumalab / hello.rb
Last active October 4, 2019 17:47
sample class
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class TestInput : MonoBehaviour
{
private Image image;
private Vector2 initPosition;
private InputField inputField;
@kazumalab
kazumalab / user_request_spec.rb
Last active August 20, 2017 06:10
ApplicationController.current_userをstubを使用した場合
require 'rails_helper'
RSpec.describe "UserController", type: :request do
describe "#index" do
let(:user) { FactoryGirl.create(:user) }
context 'success' do
before do
allow_instance_of(ApplicationController).to receive(:current_user).and_return(user)
@kazumalab
kazumalab / user_request_spec.rb
Last active August 20, 2017 06:10
ApplicationController.current_userをモックしてない場合(テストは失敗)
require 'rails_helper'
RSpec.describe "UserController", type: :request do
describe "#index" do
let(:user) { FactoryGirl.create(:user) }
context 'success' do
before do
get user_path user
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Target : MonoBehaviour {
private float RotateSpeed = 100f;
private float Radian = 0f;
private float HeadPoint = 1.2f;
@kazumalab
kazumalab / EnemyManager.cs
Created April 1, 2017 23:48
ゲームで敵を管理する場所
[Serializable]
public class EnemyManager {
private Player player;
[SerializeField]private List<Enemy> enemies = new List<Enemy> ();
public EnemyManager (Player p) {
player = p;
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Notice : MonoBehaviour {
public Sprite warning; // default
public Sprite discovery;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Enemy : MonoBehaviour {
private readonly float LookedDistance = 2f;
private Player player;
private CharacterControl cc;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Player : MonoBehaviour {
[HideInInspector]public float HeighToRoof = 0f;
private CharacterControl CharactorCTL;
private CameraControl CameraCTL;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CharacterControl : MonoBehaviour {
public bool isGround = false;
[HideInInspector]public Rigidbody rb;
private float height = 0f;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// Attach to Main Camera of CametaCenter Empty GameObject child.
public class CameraControl : MonoBehaviour {
private readonly float MAX_TURN_UP = 5f;
private readonly float MAX_TURN_DOWN = 0f;
private float InitPositionY = 0f;