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.Collections; | |
| using System.Threading.Tasks; | |
| using NUnit.Framework; | |
| using UnityEngine; | |
| using UnityEngine.TestTools; | |
| // Namespace should mirror the implementation namespace with a '.Tests' suffix. | |
| // If the implementation is under 'MyCompany.FeatureScope', then tests should be 'MyCompany.Tests.FeatureScope'. | |
| namespace MyCompany.Tests.FeatureScope | |
| { |
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 UnityEngine; | |
| public abstract class Singleton<T> : MonoBehaviour, IDisposable where T : Singleton<T> | |
| { | |
| public static T Instance { get; protected set; } | |
| void Awake() | |
| { | |
| if ( Instance != null && Instance != this ) |
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
| { | |
| "version": 1, | |
| "locktime": 0, | |
| "vin": [ | |
| { | |
| "txid": "7957a35fe64f80d234d76d83a2a8f1a0d8149a41d81de548f0a65a8a999f6f18", | |
| "vout": 0, | |
| "scriptSig" : "3045022100884d142d86652a3f47ba4746ec719bbfbd040a570b1deccbb6498c75c4ae24cb02204b9f039ff08df09cbe9f6addac960298cad530a863ea8f53982c09db8f6e3813[ALL] 0484ecc0d46f1918b30928fa0e4ed99f16a0fb4fde0735e7ade8416ab9fe423cc5412336376789d172787ec3457eee41c04f4938de5cc17b4a10fa336a8d752adf", | |
| "sequence": 4294967295 | |
| } |
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 Animal<T> : MonoBehaviour | |
| { | |
| public new T Injector; | |
| } | |
| public class Horse : Animal<ISteroidsInjector> | |
| { | |
| } |
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
| IEnumerator CreateGameAsync() | |
| { | |
| StartCoroutine( GetUsernameFromIdAsync( OpponentName.text, (id, isUsernameValid) => | |
| { | |
| if ( !isUsernameValid ) | |
| { | |
| FadeScreen.FadeBack(); | |
| GameCreationError.SetActive( true ); | |
| StartCoroutine( CoroutineHelper.WaitAndDo( 3.5f, () => { ShowMenu.OnClick(); } ) ); | |
| } |
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
| Transaction CreateUtxoSpendTxn( string rawUtxo, byte[][] msg ) | |
| { | |
| var utxo = JsonConvert.DeserializeObject<UTXO>( rawUtxo ); | |
| Debug.Log( rawUtxo ); | |
| var coin = new Coin( new uint256( utxo.TxId), (uint)utxo.OutputIndex, utxo.Satoshis, bitcoinSecret.ScriptPubKey ); | |
| var txnBuilder = NBitcoin.Altcoins.BCash.Instance.Mainnet.CreateTransactionBuilder(); | |
| return txnBuilder | |
| .AddCoins( coin ) | |
| .AddKeys( bitcoinSecret ) |
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
| #!/bin/sh | |
| FILE=$(find . -name '*.asm.framework.unityweb' -exec basename {} +) | |
| echo 'fixed '$FILE | |
| mv $FILE $FILE.gz | |
| gunzip $FILE.gz | |
| gsed -i.bak 's#function _JS_Sound_Init(){try{window.AudioContext=window.AudioContext||window.webkitAudioContext;WEBAudio.audioContext=new AudioContext;WEBAudio.audioWebEnabled=1}catch(e){alert("Web Audio API is not supported in this browser")}}#function _JS_Sound_Init(){try{window.AudioContext=window.AudioContext||window.webkitAudioContext;WEBAudio.audioContext=new AudioContext();var tryToResumeAudioContext=function(){if(WEBAudio.audioContext.state==="suspended")WEBAudio.audioContext.resume();else{clearInterval(resumeInterval)}};var resumeInterval=setInterval(tryToResumeAudioContext,400);WEBAudio.audioWebEnabled=1}catch(e){alert("Web Audio API is not supported in this browser")}}#g' $FILE | |
| rm $FILE.bak | |
| gzip --best $FILE | |
| mv $FILE.gz $FILE |
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.Collections.Generic; | |
| using System.Linq; | |
| using FullInspector; | |
| using MathUtils; | |
| using UnityEngine.UI; | |
| public class FadeGraphics : BaseBehavior | |
| { | |
| public Dictionary<float, List<Graphic>> GraphicFinalAlphaMap; |
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.Generic; | |
| using System.Linq; | |
| using UnityEditor; | |
| using UnityEngine.SceneManagement; | |
| using UnityEngine.UI; | |
| public class FindMonobehaviourInScene | |
| { | |
| [MenuItem( "Editor Utils/Select Script in Scene #&s" )] public static void SelectScriptInScene() |
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 UnityEngine; | |
| public class AdManager : GameObjectSingleton<AdManager> | |
| { | |
| public string appKey = "3fbb9d89"; | |
| bool hasRewardBeenGiven; | |
| Action onSuccess; | |
| Action onCanceled; |