Skip to content

Instantly share code, notes, and snippets.

@nabesi777
nabesi777 / Password.cs 
Last active September 21, 2018 15:11
Unity&C# Password 
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System; //記載漏れに注意 string passwordToEdit = String.Empty;で必要
public class GUIPassword : MonoBehaviour {
string passwordToEdit = String.Empty;
void OnGUI()
@nabesi777
nabesi777 / GUIWindow.cs
Created September 20, 2018 06:07
GUIWindow Unity&C#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GUIWindow : MonoBehaviour {
//widowのスタート位置x,y、Windowのサイズx,y
private Rect windowRect = new Rect(500, 200, 200, 200);
void OnGUI()
@nabesi777
nabesi777 / ScrollBar.cs
Created September 20, 2018 04:19
ScrollBar Unity&C#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ScrollTut : MonoBehaviour {
private float hScrollbarValue;
public Vector2 scrollPosition = Vector2.zero;
@nabesi777
nabesi777 / Slider.cs
Created September 20, 2018 02:30
Slider Unity&C# 
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Slidebers : MonoBehaviour
{
private float hSliderValue = 0.0f; //平行スライドバーvalue
private float vSliderValue = 0.0f; //垂直スライドバーvalue
@nabesi777
nabesi777 / TextField.cs 
Created September 19, 2018 21:55
TextField Unity C#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TextGUI : MonoBehaviour {
private string textFieldString = "text field";
private string textAreaString = "text area";
@nabesi777
nabesi777 / ShooterScript.cs
Created September 19, 2018 00:45
ShooterScript Unity&C#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ShooterScript : MonoBehaviour
{
//bulletを格納して取得する
public Transform bullet;
@nabesi777
nabesi777 / DestoyBullet.cs
Created September 19, 2018 00:43
DestoyBullet C# Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DestoyBullet : MonoBehaviour {
// Use this for initialization
void Start () {
}
@nabesi777
nabesi777 / BulletMover.cs
Created September 19, 2018 00:40
BulletMover C# unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BulletMover : MonoBehaviour {
//弾丸のスピード
private int speed = 10;
// Use this for initialization
void Start () {
@nabesi777
nabesi777 / Toolbar.cs
Created September 18, 2018 06:04
Toolbar C# Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Toolbar : MonoBehaviour {
private int toolbarInt = 0;
//配列を使用  toolbarStringsへ{}の中を代入
private string[] toolbarStrings = { "PowerUp 1 ", "PowerUp 2", "PowerUp 3" };
@nabesi777
nabesi777 / ToggleButton.cs
Created September 17, 2018 10:49
ToggleButton C# Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ToggleButton : MonoBehaviour
{
public TextMesh textMesh; //3DTextを格納
public Texture2D button; //buttonイメージを格納
public GameObject spider; //蜘蛛オブジェクトを格納