Skip to content

Instantly share code, notes, and snippets.

@nabesi777
nabesi777 / Tooltips.cs
Last active September 17, 2018 05:24
Tooltips C# Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Tooltips : MonoBehaviour
{
public TextMesh textMesh; //3DTextを格納
public Texture2D button; //buttonイメージを格納
public GameObject spider; //蜘蛛オブジェクトを格納
@nabesi777
nabesi777 / NumberDisplay_2.cs
Created September 16, 2018 02:22
NumberDisplay_2 C# unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GUIButtonTUT : MonoBehaviour
{
public TextMesh textMesh; //3DTextを格納
public Texture2D button; //buttonイメージを格納
public GameObject spider; //蜘蛛オブジェクトを格納
@nabesi777
nabesi777 / GUI_Button.cs
Created September 15, 2018 14:37
GUIButton C# Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GUIButtonTUT : MonoBehaviour {
public TextMesh textMesh; //3DTextを格納
public Texture2D button; //buttonイメージを格納
// Use this for initialization
@nabesi777
nabesi777 / RandomNumber.cs
Created September 15, 2018 13:27
RandomNumber C#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RandomGenerator : MonoBehaviour
{
public TextMesh textDisplay;
public int randomNumber;
float timer = 0.0f;
@nabesi777
nabesi777 / MoveOnly.cs
Created September 15, 2018 03:32
MoveOnly C# Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Moveonly : MonoBehaviour
{
public float speed = 10;  //playerのスピード
private Rigidbody rb;
@nabesi777
nabesi777 / ScoreText.cs
Created September 15, 2018 00:35
ScoreText C# Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI; //Textの名前空間
public class PlayerController : MonoBehaviour {
public float speed = 20;  //playerのスピード
public Text scoreText;  //textを格納する箱
public Text winText;   //textを格納する箱
@nabesi777
nabesi777 / ButtonPress.cs
Created September 14, 2018 11:16
ButtonPress Unity C#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ButtonPress : MonoBehaviour {
public Transform button;
public GameObject wall;
public Transform player;
private bool collisionOccured = false;  //衝突発生の真偽
@nabesi777
nabesi777 / Fallout.cs
Created September 14, 2018 05:25
Fallout C# Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Fallout : MonoBehaviour {
public int lives = 5; //所持ライフ
public Transform respawn; //Inspectorでrespawnを格納
public Transform fallout; //Inspectorでfalloutを格納
@nabesi777
nabesi777 / CameraSwitch.cs
Created September 13, 2018 23:20
CameraSwitch C# unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraSwitch : MonoBehaviour
{
bool isSecondary;
public GameObject mainCamera;  //mainCameraオブジェクトを入れる箱をつくる
@nabesi777
nabesi777 / FollowCamera.cs
Created September 13, 2018 16:08
FollowCamera C#
using UnityEngine;
using System.Collections;
public class FollowCamera : MonoBehaviour
{
public GameObject player;  //追いかける対象物のplyaerを入れる箱です。
private Vector3 offset = Vector3.zero;
void Start()