void OnButtonStart() { if (PlayerOneSwitch.Name == "" && PlayerTwoSwitch.Name == "") { return; } app.Engine.Blend = 1; GameCreation creation = new GameCreation(app as BurntimeClassic); NewGameInfo Info = new NewGameInfo(); Info.NameOne = PlayerOneSwitch.Name; Info.NameTwo = PlayerTwoSwitch.Name; Info.FaceOne = PlayerOneFace.FaceID; Info.FaceTwo = PlayerTwoFace.FaceID; Info.Difficulty = Difficulty.Value; Info.ColorOne = Color.IsDown ? BurntimePlayerColor.Red : BurntimePlayerColor.Green; Info.ColorTwo = Color.IsDown ? BurntimePlayerColor.Green : BurntimePlayerColor.Red; creation.CreateNewGame(Info); app.SceneManager.SetScene("WaitScene"); }
private void Awake() { spriteRenderer = GetComponent <SpriteRenderer>(); GameCreation.AddPlayer(gameObject); fireLevel = 1; StartDefend(); }
private void Awake() { spriteRenderer = GetComponent <SpriteRenderer>(); // 敌人出生后直接向下走 moveVirtical = -1; // 把敌人添加到创建管理中 GameCreation.AddEnemy(gameObject); }
// 敌人死亡 public void Died() { // 播放爆炸特效 Instantiate(explosionPrefab, transform.position, transform.rotation); // 销毁游戏物体 Destroy(gameObject); // 删除敌人 GameCreation.RemoveEnemy(gameObject); }
void OnSave() { if (input.Name == "") { return; } if (app.Server != null && app.Server.StateContainer != null) { GameCreation creation = new GameCreation(app as BurntimeClassic); creation.SaveGame("savegame/" + input.Name + ".sav"); } input.Name = ""; RefreshSaveGames(); }
void OnLoad() { if (Burntime.Platform.IO.FileSystem.ExistsFile("savegame/" + input.Name + ".sav")) { app.SceneManager.SetScene("WaitScene"); app.SceneManager.BlockBlendIn(); GameCreation creation = new GameCreation(app as BurntimeClassic); if (!creation.LoadGame("savegame/" + input.Name + ".sav")) { app.SceneManager.PreviousScene(); } app.SceneManager.UnblockBlendIn(); } input.Name = ""; RefreshSaveGames(); }
static void Main(string[] args) { GameCreation gameCreation = new GameCreation(); }