public override void LoadContent() { BasicManager.GetInstance(null).LoadContent(); if (Game1.GameInstance.useBloom) { Game1.GameInstance.bloom.LoadContent(); } }
void OnEnable() { if (main != null) { Destroy(this); } else { main = this; } }
public override void Initiliaze() { BasicManager.GetInstance(null).Initialize(); Game1.GameInstance.Overlay.Initialize(); CollisionManager.GetInstance(null).Initialize(); if (Game1.GameInstance.useBloom) { Game1.GameInstance.bloom.Initialize(); } Game1.GameInstance.Camera.Initialize(); }
public override void Draw(Microsoft.Xna.Framework.GameTime gt) { Game1.GameInstance.Draw2(gt); BasicManager.GetInstance(null).Draw(gt); if (Game1.GameInstance.useBloom) { Game1.GameInstance.bloom.Draw(gt); } Game1.GameInstance.Overlay.Draw(gt); }
public override void Update(Microsoft.Xna.Framework.GameTime gt) { Game1.GameInstance.Update2(gt); BasicManager.GetInstance(null).Update(gt); Game1.GameInstance.Overlay.Update(gt); CollisionManager.GetInstance(null).Update(gt); if (Game1.GameInstance.useBloom) { Game1.GameInstance.bloom.Update(gt); } Game1.GameInstance.Camera.Update(gt); }
public override void onEnvReady(Manager manager) { int index = Randomer.main.getInt(); //index = index % creatureList.main.names.Count; index = 3; RoleRecord data = creatureList.main.getObjectIn(index); BasicManager bm = (BasicManager)manager; int[] pos = ((ChessBoard)owner.env).getPosFor(owner); Dictionary <string, object> unitDic = null; ChessBoard cb = ((ChessBoard)owner.env); List <int[]> emptyList = new List <int[]>(); if (owner.playerNo % 2 == 0) { if (pos[1] < 3) { if (cb.board[pos[1] + 1, pos[0]] == null) { int[] tragetpos = new int[] { pos[0], pos[1] + 1 }; pos = toRelativePos(tragetpos, owner.playerNo, cb); unitDic = new Dictionary <string, object>() { { BasicManager.STR_POS_Y, pos[1] }, { BasicManager.STR_POS_X, pos[0] }, { BasicManager.STR_PLAYER_NO, owner.playerNo }, { BasicManager.STR_INF, data } }; } } if (unitDic == null) { for (int x = 0; x < cb.X; x++) { for (int y = 0; y < cb.Y / 2; y++) { if (cb.board[y, x] == null) { emptyList.Add(new int[2] { x, y }); } } } } } else { if (pos[1] > 4) { if (cb.board[pos[1] - 1, pos[0]] == null) { int[] tragetpos = new int[] { pos[0], pos[1] - 1 }; pos = toRelativePos(tragetpos, owner.playerNo, cb); unitDic = new Dictionary <string, object>() { { BasicManager.STR_POS_Y, pos[1] }, { BasicManager.STR_POS_X, pos[0] }, { BasicManager.STR_PLAYER_NO, owner.playerNo }, { BasicManager.STR_INF, data } }; } } if (unitDic == null) { for (int x = 0; x < cb.X; x++) { for (int y = cb.Y / 2; y < cb.Y; y++) { if (cb.board[y, x] == null) { emptyList.Add(new int[2] { x, y }); } } } } } if (unitDic == null) { int posidx = Randomer.main.getInt() % emptyList.Count; pos = emptyList[posidx]; pos = toRelativePos(pos, owner.playerNo, cb); unitDic = new Dictionary <string, object>() { { BasicManager.STR_POS_Y, pos[1] }, { BasicManager.STR_POS_X, pos[0] }, { BasicManager.STR_PLAYER_NO, owner.playerNo }, { BasicManager.STR_INF, data } }; } Debug.Log("創建單位x:" + unitDic[BasicManager.STR_POS_X] + ",y:" + unitDic[BasicManager.STR_POS_Y]); bm.createUnit(unitDic); }
private void Awake() { basicManager = GameObject.FindObjectOfType <BasicManager>(); vector2position = new Vector3(0, 2.5f, 0); }
private void Awake() { basicManager = GameObject.FindObjectOfType <BasicManager>(); querable1 = new Querable(); }