This file contains 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
version: 2.1 | |
executors: | |
unity: | |
docker: | |
- image: gableroux/unity3d:2019.1.14f1 | |
jobs: | |
build-test: | |
executor: unity | |
steps: | |
- checkout |
This file contains 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.Linq; | |
using HutongGames.PlayMaker; | |
using HutongGames.PlayMaker.Actions; | |
using UniRx; | |
using UniRx.Triggers; | |
using UnityEngine; | |
using Zenject; | |
public class FsmInjector : MonoBehaviour |
This file contains 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
public class Hoge : FsmStateAction | |
{ | |
[Inject] private IFuga fuga; | |
public override void OnEnter() | |
{ | |
base.OnEnter(); | |
fuga.Piyo(); | |
} | |
} |
This file contains 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
public static partial class UnityUIComponentExtensions | |
{ | |
public static IObservable<string> OnDoneAsObservable(this InputField self) | |
{ | |
return self.OnEndEditAsObservable() | |
.Where(_ => TouchScreenKeyboard.isSupported) | |
.Where(_ => self.touchScreenKeyboard.status == TouchScreenKeyboard.Status.Done) | |
.Share(); | |
} |
This file contains 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
<linker> | |
<assembly fullname="UnityEngine"> | |
<type fullname="UnityEngine.SpriteMask" preserve="all"/> | |
</assembly> | |
</linker> |
This file contains 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.Reflection; | |
using UnityEditor; | |
public static string GetClassName(int classId) | |
{ | |
var assembly = Assembly.GetAssembly(typeof(MonoScript)); | |
var unityType = assembly.GetType("UnityEditor.UnityType"); | |
var classObject = unityType.InvokeMember("FindTypeByPresistentTypeID", BindingFlags.InvokeMethod, null, null, new object[] { classId }); | |
if (classObject == null) | |
{ |
This file contains 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.Collections.Generic; | |
using System.Linq; | |
using Hecres.EditorShortcuts.Editor.ProjectSettings; | |
using Hecres.EditorShortcuts.Editor.RenderSettings; | |
using UnityEditor; | |
using UnityEngine; | |
namespace Hecres.EditorShortcuts.Editor | |
{ |
This file contains 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 void FillScreen() | |
{ | |
// orthographicSizeはカメラの垂直サイズの半分です。 | |
var worldHeight = targetCamera.orthographicSize * 2f; | |
var worldWidth = worldHeight / Screen.height * Screen.width; | |
transform.localScale = new Vector3(worldWidth, worldHeight); | |
var tempPosition = Camera.main.transform.position; | |
tempPosition.z = 0f; | |
transform.position = tempPosition; |
This file contains 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.Runtime.ExceptionServices; | |
public void Rethrow(Exception exception) | |
{ | |
ExceptionDispatchInfo.Capture(exception).Throw(); | |
} |
This file contains 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
// メソッドの場合 | |
public void OnError(Exception error) | |
{ | |
ExceptionDispatchInfo.Capture(error).Throw(); | |
} | |
// Actionデリゲートの場合 | |
public static readonly Action<Exception> Throw = ex => { ExceptionDispatchInfo.Capture(ex).Throw(); }; | |
public static readonly Action<Exception, T> Throw = (ex, _) => { ExceptionDispatchInfo.Capture(ex).Throw(); }; | |
public static readonly Action<Exception, T1, T2> Throw = (ex, _, __) => { ExceptionDispatchInfo.Capture(ex).Throw(); }; |
NewerOlder