private void Start() { BattleTeam team = BattleManager.Instance.MainCommander.GetTeam(0); for (int i = 0; i < 5; ++i) { GameObject objChara = Instantiate(prefab, transform.position, Quaternion.identity, transform); objChara.GetComponentInChildren <Renderer>().material.color = Color.red; team.AddMember(objChara.GetComponent <Character>()); } team = BattleManager.Instance.MainCommander.GetTeam(1); for (int i = 0; i < 5; ++i) { GameObject objChara = Instantiate(prefab, transform.position + Vector3.one, Quaternion.identity, transform); objChara.GetComponentInChildren <Renderer>().material.color = Color.green; team.AddMember(objChara.GetComponent <Character>()); } team = BattleManager.Instance.MainCommander.GetTeam(2); for (int i = 0; i < 5; ++i) { GameObject objChara = Instantiate(prefab, transform.position + Vector3.one * 2, Quaternion.identity, transform); objChara.GetComponentInChildren <Renderer>().material.color = Color.yellow; team.AddMember(objChara.GetComponent <Character>()); } BattleManager.Instance.BattleBegin(); Vector3 pos = transform.position; pos.y = 10; BattleManager.Instance.MainCommander.Input.MainCamera.transform.position = pos; }
private void StartBattleTest() { Bod bod1 = new Bod(); // Debug.Log ("Generated Bod: \n" + BodManager.instance.GetStats(bod1)); bod1.name = "Bod 1"; Bod bod2 = new Bod(); // Debug.Log ("Generated Bod: \n" + BodManager.instance.GetStats(bod2)); bod2.name = "Bod 2"; Bod bod3 = new Bod(); // Debug.Log ("Generated Bod: \n" + BodManager.instance.GetStats(bod3)); bod3.name = "Bod 3"; Bod bod4 = new Bod(); // Debug.Log ("Generated Bod: \n" + BodManager.instance.GetStats(bod4)); bod4.name = "Bod 4"; Bod bod5 = new Bod(); // Debug.Log ("Generated Bod: \n" + BodManager.instance.GetStats(bod5)); bod5.name = "Bod 5"; bod5.spritePath = "package_2"; Bod bod6 = new Bod(); // Debug.Log ("Generated Bod: \n" + BodManager.instance.GetStats(bod6)); bod6.name = "Bod 6"; bod6.spritePath = "package_2"; BattleTeam team1 = new BattleTeam(); team1.AddMember(bod1); team1.AddMember(bod2); team1.AddMember(bod3); team1.AddMember(bod4); BattleTeam team2 = new BattleTeam(); team2.AddMember(bod5); team2.AddMember(bod6); BattleManager.instance.Start1v1Battle(team1, team2); }