本文整理汇总了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
}