Skip to content

Instantly share code, notes, and snippets.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//オブジェクトにAudioSourceコンポーネントを追加
[RequireComponent(typeof(AudioSource))]
public class SE : MonoBehaviour
{
//音声ファイルを入れる
public AudioClip[] sound;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//NavMeshAgent使うとき必要
using UnityEngine.AI;
[RequireComponent(typeof(CapsuleCollider))]
[RequireComponent(typeof(Rigidbody))]
//オブジェクトにNavMeshAgentコンポーネントを設置
[RequireComponent(typeof(NavMeshAgent))]
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(CapsuleCollider))]
[RequireComponent(typeof(Rigidbody))]
public class Player : MonoBehaviour
{
[SerializeField] float speed = 4f;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//CapsuleColliderとRigidbodyを追加
[RequireComponent(typeof(CapsuleCollider))]
[RequireComponent(typeof(Rigidbody))]
public class Old : MonoBehaviour
{
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Axis : MonoBehaviour
{
//X軸の角度を制限するための変数
float angleUp = 60f;
float angleDown = -60f;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class HalloweenWalk : MonoBehaviour {
void Update () {
//このスクリプトをアタッチしたオブジェクトを動かす
//3つの数値はX軸、Y軸、Z軸の順になっている
this.gameObject.transform.Translate(0, 0, 0.05f);
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class HalloweenSystem : MonoBehaviour {
//Inspectorから配列にオブジェクトを設置
public GameObject[] character;
//設置するオブジェクト数
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//NavMeshAgentを使うのに必要
using UnityEngine.AI;
//オブジェクトにNavMeshAgentコンポーネントを設置
[RequireComponent(typeof(NavMeshAgent))]
public class Enum : MonoBehaviour
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//NavMeshAgent使うときに必要
using UnityEngine.AI;
//オブジェクトにNavMeshAgentコンポーネントを設置
[RequireComponent(typeof(NavMeshAgent))]
//衝突を判定するためにRigidbodyコンポーネントを設置
[RequireComponent(typeof(Rigidbody))]
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SetCube : MonoBehaviour
{
//PrefabのTargetオブジェクトを入れる
public GameObject cube;
//上から見て縦、Z軸のオブジェクトの絶対値
public int vertical = 45;