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
| function love.load() | |
| -- Comet, is going to move around the Sun | |
| comet = {} | |
| comet.x = 0 | |
| comet.y = 0 | |
| -- These are 'a' and 'b' in the ellipse formula, think aphelion and perihelion | |
| comet.trajectoryHeight = 40 | |
| comet.trajectoryWidth = 120 | |
| comet.timeItTakesToGoAroundTheSun = 3 -- 3 seconds, pretty fast | |
| comet.timeSinceBeginning = 0 |
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; | |
| // Add this MonoBehaviour to anything on the scene and it will create a prototype comet moving around a pivot | |
| public class LerpEllipseExample : MonoBehaviour | |
| { | |
| // These are 'a' and 'b' in the ellipse formula, think aphelion and perihelion | |
| float trajectoryHeight = 4; // y | |
| float trajectoryWidth = 12; // x | |
| float timeItTakesToGoAroundTheSun = 6; // 6 seconds, pretty fast |
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 UnityEngine; | |
| public class TogglePin : MonoBehaviour | |
| { | |
| private int index; | |
| private string[] commands = new[] { "pin=ON1", "pin=OFF1" }; | |
| public void Click() | |
| { | |
| string url = "http://192.168.4.1?" + commands[index]; |
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; |
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.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
| #!/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
| 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
| 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
| using UnityEngine; | |
| public class Animal<T> : MonoBehaviour | |
| { | |
| public new T Injector; | |
| } | |
| public class Horse : Animal<ISteroidsInjector> | |
| { | |
| } |
OlderNewer