//内部调用 创建UI public void initCombat(List <CombatMessage> data) { GameObject baseain = Resources.Load <GameObject>("Entity/CombatUI"); var baseMain = Instantiate(baseain); baseMain.name = "CombatView"; //baseMain.transform.SetParent(CanvasLoad.canvasui.transform, false); baseMain.transform.position = CanvasLoad.canvasui.transform.position; var mainview = baseMain.GetComponent <CombatView>(); mainview.gameObject.SetActive(true); //todo 待修改 combat = mainview; combat.initMethod(); combat.initItemData(data); //初始化界面数据 GameObject scece = Resources.Load <GameObject>("Entity/CombatScene"); var scecemain = Instantiate(scece); scecemain.name = "CombatScene"; var pos = CanvasLoad.canvasui.transform.position + new Vector3(0, 100); scecemain.transform.position = pos; scecemain.transform.SetParent(CanvasLoad.instance.uiPos.transform); //添加相机资源 var combatcam = scecemain.GetComponentInChildren <Camera>(); ViewController.instance.addCameraDictionary("combatcam", combatcam); combatScene = scecemain; }
private CombatMessage willActionActor = null; //待操作的单位 //manager调用 初始化并自动创建单例 public void initController() { combat = null; combatScene = null; iswait = false; messageActor = new List <CombatMessage>(); attackAction = new AttackAction(); //willActionActor = new List<CombatMessage>(); }
public void LoadScene(UIScene newscene) { try { uiscene = newscene; uiscene.Draw(); combat_view = new CombatView(); } catch (NullReferenceException e) { Console.WriteLine("ERROR >> new scene is null"); } }
protected override void OnInit(Point2D position, object[] args) { view = Session.Screen.CombatView; view.Visible = true; view.Click += OnClick; view.Give += OnGive; meter = Session.Screen.CombatMeter; meter.Visible = true; window = Session.Screen.CombatWindow; window.Visible = true; }
protected override void OnResize(int newWidth, int newHeight) { MapView.Resize(newWidth, newHeight); Belt.Move((newWidth - Belt.Width) / 2, newHeight - Belt.Height - 10); Calendar.Move((newWidth - Calendar.Width) / 2, Calendar.Y); Container.Move((newWidth - Container.Width) / 2, (newHeight - Container.Height) / 2); Chat.Move(10, newHeight - Chat.Height - 10); MenuGrid.Move(newWidth - MenuGrid.Width - 5, newHeight - MenuGrid.Height - 5); HudMenu.Move(newWidth - HudMenu.Width - 10, newHeight - HudMenu.Height - MenuGrid.Height - 10); escapeWindow.Move((newWidth - 100) / 2, (newHeight - 100) / 2); CombatMeter.Move((newWidth - Calendar.Width) / 2, Calendar.Y); CombatView.Move((newWidth - CombatView.Width - 10), 10); Aim.Move((newWidth - Aim.Width) / 2, (newHeight - Aim.Height) / 2); }
private void Enter() { for (int i = 0; i < mTimerTask.Count; i++) { TimeManage.Instance.RemoveTimerTask(mTimerTask[i]); } mPlayCard = null; mTimerTask.Clear(); mCombatMode.Init(); if (mCombatView == null) { mCombatView = ResourceManage.Instance.LoadPrefab("CombatView").AddComponent <CombatView>(); } mCombatView.Init(); }
public GameScreen() { escapeWindow = new EscapeWindow(RootWidget); escapeWindow.Visible = false; escapeWindow.Closed += () => escapeWindow.Visible = false; escapeWindow.Logout += Close; escapeWindow.Exit += App.Exit; Container = new Container(Root); // HACK: to display character selection screen nicely Container.Resize(800, 600); Container.Visible = false; MapView = new MapView(Root); MapView.Visible = false; Calendar = new Calendar(Root); Calendar.Visible = false; MenuGrid = new MenuGrid(Root); MenuGrid.Visible = false; HudMenu = new HudMenu(Root); HudMenu.Visible = false; Belt = new Belt(Root); Belt.Visible = false; Chat = new ChatWindow(Root); Chat.Resize(300, 200); Chat.Visible = false; CombatMeter = new CombatMeter(Root); CombatMeter.Visible = false; CombatView = new CombatView(Root); CombatView.Visible = false; CombatWindow = new CombatWindow(Root); CombatWindow.Move(100, 100); CombatWindow.Visible = false; Aim = new AimWidget(Root); Aim.Visible = false; RegisterHotkeys(); }
public void Play(Character target, System.Action finished, System.Action activated) { activated(); var allies = factionManager.GetAllies(target); allies.Remove(target); var justTarget = new List <Character>(); justTarget.Add(target); var positions = CombatView.GetNewPositions(allies, justTarget, target.myFaction); var newPosition = positions[0]; var art = target.ownerGO; LeanTween.move(art, newPosition, GlobalVariables.moveTime).setEase(LeanTweenType.easeOutQuad).setOnComplete(() => finished()); }
public void playCombatBeHit(CombatView combat, AttackResult result) {//播放被击动画 并调用合适的视图面板变动 Debug.Log("【播放动画】攻击方:" + result.sourceActor.Name + " 受击方:" + result.takenActor[0].Name); Debug.Log("【参数】异常状态" + result.takenActor[0].Abnormal.Count + "个【附加异常】" + result.inflictionID.Count); //if (result.sourceActor.AtkExtra.Count != 0) { Debug.Log(result.sourceActor.AtkExtra[0].id); } //if (result.extraHit!=null && result.extraHit.Length != 0) { Debug.Log(result.extraHit[0]); } Debug.Log("【战斗数据】" + result.sourceActor.Name + ":" + result.sourceActor.UnitData["curHp"] + " " + result.takenActor[0].Name + ":" + result.takenActor[0].UnitData["curHp"]); //全部播放完成后 if (result.willDeadActor.Count != 0) { } void action() { combatNextStep(); } playAnimation(result.sourceActor.Prefab.GetComponentInChildren <Animator>().gameObject, "testAction", false, action); }
public PlayCard() { mCombatController = ControllerManage.Instance.mCombatController; mCombatView = mCombatController.mCombatView; if (mCombatView.mPlayer.mLandlord.activeSelf) { player = mCombatView.mPlayer.gameObject; } else if (mCombatView.mPlayerAI1.mLandlord.activeSelf) { player = mCombatView.mPlayerAI1.gameObject; } else if (mCombatView.mPlayerAI2.mLandlord.activeSelf) { player = mCombatView.mPlayerAI2.gameObject; } playersOrder[0] = mCombatView.mPlayer.gameObject; playersOrder[1] = mCombatView.mPlayerAI1.gameObject; playersOrder[2] = mCombatView.mPlayerAI2.gameObject; }
public CombatScene(GameController controller) { Controller = controller; CombatView = new CombatView(CombatOffset, CombatSize); }
public void strategicAttack() { selectingTargets = true; Game game = Game.GetInstance(); if (!game.LocalPlayers.Contains(game.State.CurrentPlayer)) return; combatView = game.GUI.CombatView; combatView.Attacker = game.State.CurrentPlayer; combatView.showStrategicTargetSelection(); }
public void playCombatSceneTransform(CombatView combat, int type) {//加载入场动画 普通切换 动画为 0 //PubTool.Instance.addStep(loadAnim); }