Skip to content

Instantly share code, notes, and snippets.

#! /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`
@quabug
quabug / Example.cs
Created April 14, 2019 09:23
Create Unity ECS systems by zenject way which automaticly inject necessary instances into constructor of system.
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();
}
}
using System;
using System.Collections.Generic;
using UnityEngine;
using Zenject;
public interface IRecyclableObject
{
GameObject GameOjbect { get; }
void Reset();
void Recycle();
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)
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):
@quabug
quabug / gist:5181623
Created March 17, 2013 13:59
1、第一個答案是b的問題是哪一道?   (a)2;(b) 3;(c)4;(d)5;(e)6 2、唯一兩道具有連續相同答案的題目是?   (a)2,3;(b)3,4;(c)4,5;(d)5,6;(e)6,7;   3、本題答案與哪一題相同?   (a)1;(b)2;(c)4;(d)7;(e)6   4、答案是a的問題個數是?  (a)0;(b)1;(c)2;(d)3;(e)4   5、本題答案與哪一題相同?  (a)10;(b)9;(c)8;(d)7;(e)6   6、答案是a的問題數量與答案是什麼的問題數量相同?   (a)b;(b)c;(c)d;(d)e;(e)以上都不是   7、按照字母順序,本題答案與下一題相差幾個字母?   (a)4;(b)3;(c)2;(d)1;(e)0。(注…
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 }