Skip to content

Instantly share code, notes, and snippets.

@nabesi777
nabesi777 / ChaCon.cs
Created September 30, 2018 22:42
キャラ動き(階段・ジャンプ・走り・歩き)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(CharacterController))]
public class ChaCon : MonoBehaviour
{
public float speed;
@nabesi777
nabesi777 / main.cs
Created September 30, 2018 07:56
視点ポインターでシーン移行
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class Main : MonoBehaviour
{
public GameObject button;
private bool count;
@nabesi777
nabesi777 / OpacityVR.cs
Created September 29, 2018 08:29
Unity&VR 視点ポインターが当たったときオブジェクトの透明度を変える
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Opacity : MonoBehaviour
{
bool sight;
Color color;
float red, green, blue, alpha; //RGBを操作するための変数
@nabesi777
nabesi777 / shader.text
Created September 26, 2018 14:16
シェーダースクリプトの構造
//シェーダー宣言、ファイルで一つだけ必要 /で階層化 以下ShaderLab言語
Shader "Unlit/NewUnlitShader"
{ 
//プロパティ宣言(インスペクター上で表示する項目を記述)
//テクスチャだけではなく数値やカラーも設定できる
Properties
{//左から、シェーダー内で使う変数(インスペクター上で表示する名称、受取リソースの種類)
//=初期値(テクスチャが指定されない時は白表示) {}は互換性の関係で記述
_MainTex ("Texture", 2D) = "white" {}
@nabesi777
nabesi777 / UniConcs
Last active September 25, 2018 13:21
UnityChan ダンジョン向きController
using UnityEngine;
using System.Collections;
namespace UnityChan
{
// 必要なコンポーネントの列記
[RequireComponent(typeof(Animator))]
[RequireComponent(typeof(CapsuleCollider))]
[RequireComponent(typeof(Rigidbody))]
@nabesi777
nabesi777 / GUIPassword.cs
Last active September 25, 2018 08:21
Unity&C# GUIログイン画面
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Login : MonoBehaviour
{
private string u = "aaa"; //IDを設定
private string p = "111"; //passwordを設定
@nabesi777
nabesi777 / GUISkin.cs
Last active October 20, 2022 09:29
GUISkin Unity&C#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Layouttest : MonoBehaviour
{
private float sliderValue = 1.0f;
private float maxSliderValue = 10.0f;
private float spaceSize; //
@nabesi777
nabesi777 / GUILayoutTUT.cs
Created September 22, 2018 09:44
Unity&C# GUILayoutTUT
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GUILayoutTUT : MonoBehaviour
{
private float sliderValue = 1.0f;
private float maxSliderValue = 10.0f;
void OnGUI()
@nabesi777
nabesi777 / PlayerMoveController.cs
Last active September 22, 2018 05:34
PlayerMoveController Unity&C#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMoveController : MonoBehaviour
{
public Animator anim;
public Rigidbody rbody;
//private bool run;
@nabesi777
nabesi777 / FollowCamera.cs
Created September 22, 2018 05:33
FollowCamera C# Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FollowCamera : MonoBehaviour
{
public Transform target;
public float smoothing = 5f;
private Vector3 offset;