本文整理匯總了Golang中github.com/runningwild/cgf.Engine.Unpause方法的典型用法代碼示例。如果您正苦於以下問題:Golang Engine.Unpause方法的具體用法?Golang Engine.Unpause怎麽用?Golang Engine.Unpause使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/runningwild/cgf.Engine
的用法示例。
在下文中一共展示了Engine.Unpause方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: LocalThink
func LocalThink(sys system.System, engine *cgf.Engine, game *Game) {
sys.Think()
engine.Pause()
// We might have no level if the event has not gone through yet.
if game.Level != nil {
render.Queue(func() {
game.Render()
sys.SwapBuffers()
})
game.Level.LocalThink(sys, engine)
}
render.Purge()
engine.Unpause()
}
示例2: debugHookup
func debugHookup(version string) *cgf.Engine {
var err error
for false && len(sys.GetActiveDevices()[gin.DeviceTypeController]) < 2 {
time.Sleep(time.Millisecond * 100)
sys.Think()
}
var engine *cgf.Engine
if version != "host" {
engine, err = cgf.NewClientEngine(17, "thunderingvictory.dyndns.org", 20007, base.EmailCrashReport, base.Log())
if err != nil {
base.Log().Printf("Unable to connect: %v", err)
base.Error().Fatalf("%v", err.Error())
}
} else {
sys.Think()
g := game.MakeGame()
if version == "host" {
engine, err = cgf.NewHostEngine(g, 17, "", 20007, base.EmailCrashReport, base.Log())
if err != nil {
panic(err)
}
err = cgf.Host(20007, "thunderball")
if err != nil {
panic(err)
}
} else {
engine, err = cgf.NewLocalEngine(g, 17, base.EmailCrashReport, base.Log())
}
if err != nil {
base.Error().Fatalf("%v", err.Error())
}
}
engine.Pause()
engine.GetState().(*game.Game).SetSystem(sys)
engine.Unpause()
base.Log().Printf("Engine Id: %v", engine.Id())
base.Log().Printf("All Ids: %v", engine.Ids())
return engine
}