상속: MonoBehaviour
예제 #1
0
        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");
        }
예제 #2
0
 private void Awake()
 {
     spriteRenderer = GetComponent <SpriteRenderer>();
     GameCreation.AddPlayer(gameObject);
     fireLevel = 1;
     StartDefend();
 }
예제 #3
0
파일: Enemy.cs 프로젝트: git8023/tank90
    private void Awake()
    {
        spriteRenderer = GetComponent <SpriteRenderer>();
        // 敌人出生后直接向下走
        moveVirtical = -1;

        // 把敌人添加到创建管理中
        GameCreation.AddEnemy(gameObject);
    }
예제 #4
0
파일: Enemy.cs 프로젝트: git8023/tank90
    // 敌人死亡
    public void Died()
    {
        // 播放爆炸特效
        Instantiate(explosionPrefab, transform.position, transform.rotation);

        // 销毁游戏物体
        Destroy(gameObject);

        // 删除敌人
        GameCreation.RemoveEnemy(gameObject);
    }
예제 #5
0
        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();
        }
예제 #6
0
        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();
        }
예제 #7
0
 static void Main(string[] args)
 {
     GameCreation gameCreation = new GameCreation();
 }