// Use this for initialization void Awake() { Toolbox toolboxInstance = Toolbox.Instance; // game boy battle scene if (toolboxInstance.battleScene.Equals("GameBoy")) { // add the component for the gameboy battle scene GameBoyLoadGame gameBoy = gameObject.AddComponent <GameBoyLoadGame>(); gameboyCanvas.enabled = true; basicCanvas.enabled = false; // set up some variables gameBoy.gameboyCharacter = gameboyCharacter; gameBoy.gameboyEnemy = gameboyEnemy; gameBoy.tempPlayerXML = tempPlayerXML; gameBoy.healthBarLostTick = healthBarLostTick; gameBoy.healthBarTick = healthBarTick; Camera.main.orthographicSize = 1; Debug.Log("game boy battle scene"); } // basic battle scene else { // add the component for the basic scene gameObject.AddComponent <LoadBattleScene>(); gameboyCanvas.enabled = false; basicCanvas.enabled = true; Camera.main.orthographicSize = 2; Debug.Log("basic battle scene"); } }
// maybe it should be up to the battle manager to store good guys and bad guys? // Use this for initialization void Start() { // if we have a gameboy game, delete this object if (Toolbox.Instance.battleScene != "GameBoy") { Destroy(this); } // The battle manager contains a list of scripts as attached to objects // INIT will get the list of objects and do some setup // DECIDE ON TURN will call the queue and toggle at this point // DECIDE ATTACK will simply call the units attack // PERFORM COMMANDS will perform the attack's commands // Check conditions will just determine if we are done with the round // WIN will fire the winning conditions off // LOSE will fire the losing conditions off // Battle Manager // - START / INIT // - DECIDE WHOSE TURN IT IS (speed and turn queue? - for now we'll just swap off in a simple turn based queue) // - DECIDE ATTACK (random if enemy) // - PERFORM COMMANDS // - CHECK CONDITIONS // - WIN // - LOSE currentState = BATTLE_STATES.START; sceneInit = GameObject.Find("LoadScene").GetComponent <GameBoyLoadGame> (); Camera.main.orthographicSize = 1; Camera.main.transform.position = new Vector3(-3.78f, -1.30f, -10); sceneInit.LoadCharacters(); }