This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private List<AudioClip> seAudioClips = new List<AudioClip>(); | |
void Awake () { | |
seAudioClips = Resources.LoadAll(filePath, typeof(AudioClip)).Cast<AudioClip>().ToList(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class UIPlayAtom : MonoBehaviour | |
{ | |
public string cueName; //再生するキュー名// | |
public string cueSheet; //再生するキューが入ったキューシート名// | |
public float volume; | |
public flota pitch; | |
static CriAtomSource atomSourceNGUI; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
namespace Util { | |
public class DebugInEditor : MonoBehaviour | |
{ | |
public static void Log(string log) | |
{ | |
#if UNITY_EDITOR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
///Requires Transparent Material/// | |
///マテリアルの出現エフェクト/// | |
public class AppearEffect : MonoBehaviour{ | |
[SerializeField] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void CreateScriptableObjectAndSave(string assetPath) | |
{ | |
//アセットの生成// | |
AssetDatabase.CreateAsset ((ScriptableObject)someScriptableObject, assetPath); | |
//変更ここから// | |
AssetDatabase.StartAssetEditing(); | |
//ここで生成したScriptableObjectにデータを入れる処理// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System; | |
public class SoundManager : SingletonMonoBehaviour<SoundManager>,IPausable { | |
//From resources folder// | |
public string seAudioClipPath = "AudioClips/SE"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Security.Cryptography; | |
using System.Text; | |
using UnityEngine; | |
/// <summary> | |
/// stringまたはシリアライズ可能なクラスをJSONに変換してAES暗号化して保存・読み込みする// | |
/// 参考: http://qiita.com/tempura/items/ad154d1269882ceda0f4 | |
/// </summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//UnityMonoでDateTimeOffset.ToOffset(TimeSpan)が死ぬための処置// | |
//なお拡張メソッドでDateTimeに生やそうとするとオフセットが正常に取得できず死ぬ// | |
using System; | |
public static class DateTimeConverter | |
{ | |
public static DateTime UtcToLocal(DateTime utcTime) | |
{ | |
TimeSpan offset = TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Text; | |
public static class Utility | |
{ | |
public static string GenerateRandomAlphanumeric(int length = 44, bool removeMistakableChar = true) | |
{ | |
string guid = Guid.NewGuid().ToString("N"); | |
string str = Convert.ToBase64String(Encoding.UTF8.GetBytes(guid)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// 使い方 Canvas下に空RestTransformを作りこれを貼る、下にスティック画像のImageをぶら下げてパブリックフィールドに設定する、GetAxis~から値を拾う。// | |
/// </summary> | |
/// <returns></returns> | |
using UnityEngine; | |
using UnityEngine.EventSystems; | |
using UnityEngine.UI; | |
public class JoyStick : Graphic, IEndDragHandler, IDragHandler, IPointerDownHandler, IPointerUpHandler | |
{ |
OlderNewer