View UMGame.gd
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
class UMGameAgent: | |
var agent | |
func _init(agent): | |
self.agent = agent | |
func startLevel(var level): | |
agent.startLevel(level) | |
func failLevel(var level): | |
agent.failLevel(level) | |
func finishLevel(var level): |
View TalkingGame.gd
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
class TalkingGame: | |
var agent | |
func _init(agent): | |
self.agent = agent | |
func onVirtualCurrencyReward(virtualCurrencyAmount, reason): | |
agent.onVirtualCurrencyReward(float(virtualCurrencyAmount), reason) | |
func onItemPurchase(item, itemNumber, priceInVirtualCurrency): | |
agent.onItemPurchase(item, itemNumber, float(priceInVirtualCurrency)) | |
func onItemUse(item, itemNumber): | |
agent.onItemUse(item, itemNumber) |
View gist:5181623
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
import itertools | |
candidates = itertools.product('abcde', repeat=10) | |
for c in candidates: | |
if q1(c) and q2(c) and q3(c) and q4(c) and q5(c) and q6(c) and q7(c) and q8(c) and q9(c) and q10(c): | |
print(c) | |
def q1(candidate): | |
this_answer = candidate[0] | |
answers = { 'a':2, 'b':3, 'c':4, 'd':5, 'e':6 } |
View ObjectPool.cs
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 UnityEngine; | |
using Zenject; | |
public interface IRecyclableObject | |
{ | |
GameObject GameOjbect { get; } | |
void Reset(); | |
void Recycle(); |
View unity-pack.sh
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
#! /bin/bash | |
tmp_dir=`mktemp -d -t unitypackage-XXXXXXXX` | |
package_dir=$1 | |
output_path=${2:-'output.unitypackage'} | |
function make_meta_directory() { | |
meta_file=$1 | |
asset_file=${meta_file%.*} | |
guid=`yq e '.guid' $meta_file` |
View Example.cs
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
class MainInstaller : MonoInstaller<MainInstaller> | |
{ | |
public override void InstallBindings() { | |
Container.BindInstance(World.Active); | |
Container.Bind<WorldSystemCreatorFactory>().AsSingle().WithArguments(Container); | |
Container.Bind<SomeService>().ToSelf().AsSingle(); | |
Container.Bind<Example>().ToSelf().AsSingle().NonLazy(); | |
} | |
} |