void Awake() { InvManager = FindObjectOfType(typeof(InventoryManager)) as InventoryManager; //Get the Inventory Manager object/script. InvEquipment = FindObjectOfType(typeof(Equipment)) as Equipment; //Get the Equipment script. InvSkillBar = FindObjectOfType(typeof(SkillBar)) as SkillBar; //Get the skill bar script. CustomEvents = FindObjectOfType(typeof(InventoryEvents)) as InventoryEvents; InvVendor = FindObjectOfType(typeof(VendorUI)) as VendorUI; InvCraft = FindObjectOfType(typeof(CraftManager)) as CraftManager; InvContainer = FindObjectOfType(typeof(ContainerUI)) as ContainerUI; InvEquipmentUI = FindObjectOfType(typeof(EquipmentUI)) as EquipmentUI; InvItemGroup = FindObjectOfType(typeof(ItemGroupUI)) as ItemGroupUI; //Setting up rect transforms: UICanvasTrans = UICanvas.GetComponent <RectTransform>(); PanelTrans = Panel.GetComponent <RectTransform>(); SetInvPosition(); // Set the default position of the inventory backdrop. CreateRiches(); //Set all riches slots. ActionMenu.gameObject.SetActive(false); DropMenu.gameObject.SetActive(false); ShowInv = false; // Panel.SetActive(false); //--hide at start }
public static void loadSkillBar(Character chr) { using (var con = new MySqlConnection(MasterServer.Instance.SqlConnection.mConnectionString)) using (var cmd = con.CreateCommand()) { con.Open(); cmd.CommandText = "SELECT * FROM chars_sbar WHERE charID=" + chr.getuID(); using (var reader = cmd.ExecuteReader()) { reader.Read(); if (!reader.HasRows) { return; } else { SkillBar sBar = chr.getSkillBar(); for (byte i = 0; i < 21; i++) { int skillID = reader.GetInt32(i + 1); if (skillID != -1) { sBar.addToSkillBar(i, skillID); } } } } } }
public void Init(GameObject cameraObj) { GameObject obj = ResourceSystem.Instance.NewObject("UI/SkillBar") as GameObject; Canvas canvas = obj.GetComponent<Canvas>(); if (null != canvas && null != cameraObj) { canvas.renderMode = RenderMode.ScreenSpaceCamera; canvas.worldCamera = cameraObj.GetComponent<Camera>(); uiCamera = canvas.worldCamera; } skillBar = obj.GetComponent<SkillBar>(); skillBar.Clear(); //订阅 subscribes.Add(Utility.EventSystem.Subscribe<int, int, int>("ui_add_skill_button", "ui", AddSkillButton)); subscribes.Add(Utility.EventSystem.Subscribe("ui_remove_skill_buttons", "ui", RemoveAllSkillButtons)); subscribes.Add(Utility.EventSystem.Subscribe<int, float, int>("ui_actor_mp", "ui", ChangeMp)); subscribes.Add(Utility.EventSystem.Subscribe<int, float>("ui_actor_hp", "ui", ChangeHp)); subscribes.Add(Utility.EventSystem.Subscribe<int, int, float>("ui_skill_cooldown", "ui", OnSkillCooldown)); subscribes.Add(Utility.EventSystem.Subscribe("ui_show", "ui", Show)); subscribes.Add(Utility.EventSystem.Subscribe("ui_hide", "ui", Hide)); //发布 //队员技能 skillBar.onSelectSkill = (int objID,int skillID) => { Utility.SendMessage("GameRoot", "OnCastSkill", new object[] { objID, skillID }); }; }
void OnEnable() { try { //结束画面开始前结束普通攻击 UnityEngine.GameObject go = UIManager.Instance.GetWindowGoByName("FightUI"); if (go != null) { SkillBar sBar = go.GetComponent <SkillBar>(); if (sBar != null) { sBar.StopAttack(); if (ArkCrossEngine.LogicSystem.PlayerSelf != null) { GfxModule.Skill.GfxSkillSystem.Instance.StopAttack(ArkCrossEngine.LogicSystem.PlayerSelf); } } } //UIManager.Instance.HideWindowByName("MpveCombatFail"); } catch (System.Exception ex) { ArkCrossEngine.LogicSystem.LogErrorFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace); } }
// Update is called once per frame protected void Update() { //延迟获取技能UI条 if (SkillUI == null) { GameObject UIbar = GameObject.Find(UiBarName.ToString()); if (UIbar == null) { return; } SkillUI = UIbar.GetComponent <SkillBar>(); SkillUI.Initialize(SkillIcon); return; } if (Input.GetKeyDown(hotKey) && !SkillInCd) { DoSkillBody(); SkillInCd = true; Debug.Log("CD is begin" + System.DateTime.Now); Invoke("SkillCdOver", Skill_Cd); SkillUI.EnterSkillCd(Skill_Cd); } if (Input.GetKeyUp(hotKey)) { CancleSkillBody(); } }
private void OnUpdate(object sender, ElapsedEventArgs e) { timerUpdate.Stop(); if (closed || isInitializing || disposed) { return; } this.Invoke((MethodInvoker) delegate { if (closed || isInitializing || disposed) { return; } if (!initedCursorPos) { initedCursorPos = true; Cursor.Position = SkillBar.SkillBarLocation; } Color col = ColorUtils.GetColorAt(SkillBar.SkillBarLocation); lblSkillBarLocation.Text = $"Skill bar location: {SkillBar.SkillBarLocation}, Color: R:{col.R}, G:{col.G}, B:{col.B}"; for (int i = 0; i < skillsInt.Count; i++) { if (skillsInt[i] != Constants.NONE) { skills[i].Display(SkillBar.GetSkillForNumber(skillsInt[i])); } } timerUpdate.Start(); }); }
override public void destroy() { base.destroy(); mText.destroy(); mText = null; optionsBttn.destroy(); optionsBttn = null; mBoard.destroy(); mBoard = null; monster.destroy(); monster = null; building.destroy(); building = null; screenDim.destroy(); screenDim = null; skills.destroy(); skills = null; backMenuBttn.destroy(); backMenuBttn = null; tryAgainBttn.destroy(); tryAgainBttn = null; btnNextScreen.destroy(); btnNextScreen = null; }
public void Initialize(ContentManager content, GraphicsDeviceManager graphics, List<Enemy> enemies, Player player) { this.content = content; this.playerLocationOffset = new Vector2(-graphics.GraphicsDevice.Viewport.Width / 2 + 250, -graphics.GraphicsDevice.Viewport.Height / 2 + 300); this.playerZonesLocationOffset = new Vector2(-graphics.GraphicsDevice.Viewport.Width / 2 + 250, -graphics.GraphicsDevice.Viewport.Height / 2 + 350); this.enemies = enemies; this.player = player; this.graphics = graphics; playerHealthBar = new StatusBar(new Rectangle(0, 0, 210, 15)); playerHealthBar.Initialize(graphics, content); playerHealthBar.EdgeColor = Color.Black; playerHealthBar.ShowEdges = true; playerHealthBar.BarColor = Color.DarkRed; playerHealthBar.EdgeThickness = 1; playerHealthBar.ShowText = true; playerHealthBar.TextColor = Color.Yellow; playerRageBar = new StatusBar(new Rectangle(0, 0, 210, 15)); playerRageBar.Initialize(graphics, content); playerRageBar.EdgeColor = Color.Black; playerRageBar.ShowEdges = true; playerRageBar.BarColor = Color.Yellow; playerRageBar.EdgeThickness = 1; playerRageBar.ShowText = true; playerRageBar.TextColor = Color.Black; skillBar = new SkillBar(player); cooldownFont = content.Load<SpriteFont>(Constants.GameFont); }
public CSurvivalState(CInfo stageInfo) { CGame.inst().setImage("Sprites/level_Background00"); CurrentStageData.clearData(); SoundList.instance.playLevelMusic(); tryAgainInfo = stageInfo; switch (stageInfo.Kaiju) { case 1: monster = new Dinosaur(stageInfo.startStage, stageInfo.firstStage, stageInfo.secondStage); break; case 2: monster = new Kong(stageInfo.startStage, stageInfo.firstStage, stageInfo.secondStage); break; case 3: monster = new Kraken(stageInfo.startStage, stageInfo.firstStage, stageInfo.secondStage); break; } current_state = STATE_PLAYING; CurrentStageData.difficulty = 0; mBoard = new Board(1); building = new Enemy(0); timeLeft = new CText("Time: ", CText.alignment.TOP_CENTER); timeLeft.setX(0); timeLeft.setY(0); timeLeft.setColor(Color.black); scoreText = new CText("SCORE :", CText.alignment.TOP_CENTER); scoreText.setX(400); scoreText.setY(0); scoreText.setColor(Color.black); btnNextScreen = new CSprite(); btnNextScreen.setSortingLayer("TextUI"); mBoard.targetScore = stageInfo.TargetScore; // MOVE TO CLASS float scoreCoefficient = (float)70 / (float)mBoard.targetScore; skills = new SkillBar(stageInfo.Kaiju); mTimer = new Timer(); CurrentStageData.assignData(monster, mBoard, scoreCoefficient, skills); CurrentStageData.assignTimer(mTimer); screenDim = new CSprite(); screenDim.setSortingLayer("ScreenShade"); screenDim.setName("Sombra"); backMenuBttn = new CSprite(); backMenuBttn.setSortingLayer("TextUI"); tryAgainBttn = new CSprite(); tryAgainBttn.setSortingLayer("TextUI"); optionsBttn = new CSprite(); optionsBttn.setImage(Resources.Load <Sprite>("Sprites/Buttons/Pause_Button")); optionsBttn.setXY(680, 40); optionsBttn.setSortingLayer("TextUI"); }
public Character() { this.equipment = new Equipment(this); this.inventory = new Inventory(this); this.cargo = new Cargo(this); this.skills = new Skills(this); this.skillBar = new SkillBar(); this.community = new Community(); }
public void Awake() { canDrop = false; cost = 10; key = KeyCode.Alpha5; mySkillBar = GetComponent<SkillBar>(); }
void Start() { if (controlUI && photonView.isMine) { skillbar = FindObjectOfType <SkillBar>(); skillbar.InitializeSkill(key, icon); } StartBehaviour(); }
public void MageSpecial() { if (IsAttacking || !SkillBar.DecSkillPoints(30)) { return; } FloatingText.Show("Special!!!", "PlayerSpecialText", new FromWorldPointTextPositioner(Camera.main, transform.position, 2f, 60f)); }
void Awake() { workerName = transform.Find("Name").GetComponent <TextMeshProUGUI>(); workerProfession = transform.Find("Profession").GetComponent <TextMeshProUGUI>(); professionText = workerProfession.text; picture = transform.Find("Picture").GetComponent <Picture>(); skillPhys = transform.Find("SkillBarPhys").GetComponent <SkillBar>(); skillTech = transform.Find("SkillBarTech").GetComponent <SkillBar>(); skillTrade = transform.Find("SkillBarTrade").GetComponent <SkillBar>(); }
void Awake() { InvManager = FindObjectOfType(typeof(InventoryManager)) as InventoryManager; //Get the Inventory Manager object/script. InvSkillBar = FindObjectOfType(typeof(SkillBar)) as SkillBar; //Get the skill bar script. CustomEvents = FindObjectOfType(typeof(InventoryEvents)) as InventoryEvents; //Setting up rect transforms: UICanvasTrans = UICanvas.GetComponent <RectTransform>(); PanelTrans = Panel.GetComponent <RectTransform>(); }
void Awake() { picture1 = transform.Find("Picture1").GetComponent <Picture>(); picture2 = transform.Find("Picture2").GetComponent <Picture>(); picture3 = transform.Find("Picture3").GetComponent <Picture>(); skillPhys = transform.Find("SkillBarPhys").GetComponent <SkillBar>(); skillTech = transform.Find("SkillBarTech").GetComponent <SkillBar>(); skillTrade = transform.Find("SkillBarTrade").GetComponent <SkillBar>(); description = transform.Find("Description").GetComponent <TextMeshProUGUI>(); fromName = transform.Find("FromName").GetComponent <TextMeshProUGUI>(); }
public override void Render() { base.Render(); var hoverUi = GameController.Game.IngameState.UIHoverTooltip.Tooltip; var skills = SkillBar.CurrentSkills(); foreach (var skill in skills) { var box = skill.SkillElement.GetClientRect(); var newBox = new RectangleF(box.X, box.Y - 2, box.Width, -15); decimal value; if (hoverUi.GetClientRect().Intersects(newBox) && hoverUi.IsVisibleLocal) { continue; } if (skill.Skill.Stats.TryGetValue(GameStat.HundredTimesDamagePerSecond, out var val0)) { value = val0 / (decimal)100d; } else if (skill.Skill.Stats.TryGetValue(GameStat.HundredTimesAttacksPerSecond, out var val1)) { value = val1 / (decimal)100d; } else if (skill.Skill.Stats.TryGetValue(GameStat.HundredTimesAverageDamagePerSkillUse, out var val2)) { value = val2 / (decimal)100d; } else if (skill.Skill.Stats.TryGetValue(GameStat.IntermediaryFireSkillDotDamageToDealPerMinute, out var val3)) { value = val3 / (decimal)60; } else if (skill.Skill.Stats.TryGetValue(GameStat.BaseSkillShowAverageDamageInsteadOfDps, out var val4)) { value = val4 / (decimal)100d; } else { continue; } // // if (value <= 0) continue; var pos = new Vector2(newBox.Center.X, newBox.Center.Y - Settings.FontSize / 2f); Graphics.DrawText(ToKmb(Convert.ToDecimal(value)), pos, Settings.FontColor, Settings.FontSize, FontAlign.Center); Graphics.DrawBox(newBox, Settings.BackgroundColor); Graphics.DrawFrame(newBox, Settings.BorderColor, 1); } }
public CLevelState(int stageNumber) { SoundList.instance.playLevelMusic(); CInfo stageInfo = LevelsInfo.getLevel(stageNumber); CGame.inst().setImage("Sprites/level_Background0" + stageInfo.building.ToString()); CurrentStageData.currentStage = stageNumber; switch (stageInfo.Kaiju) { case 1: monster = new Dinosaur(stageInfo.startStage, stageInfo.firstStage, stageInfo.secondStage); break; case 2: monster = new Kong(stageInfo.startStage, stageInfo.firstStage, stageInfo.secondStage); break; case 3: monster = new Kraken(stageInfo.startStage, stageInfo.firstStage, stageInfo.secondStage); break; } current_state = STATE_PLAYING; CurrentStageData.difficulty = stageInfo.dif; mBoard = new Board(0); //monster = new Kong(1, 53, 76); building = new Enemy(stageInfo.building); mText = new CText("TEST", CText.alignment.TOP_CENTER); mText.setX(0); mText.setY(0); mText.setColor(Color.black); mBoard.movementsLeft = stageInfo.movements; // MOVE TO CLASS mBoard.targetScore = stageInfo.TargetScore; // MOVE TO CLASS float scoreCoefficient = (float)70 / (float)mBoard.targetScore; skills = new SkillBar(stageInfo.Kaiju); CurrentStageData.assignData(monster, mBoard, scoreCoefficient, skills); screenDim = new CSprite(); screenDim.setSortingLayer("ScreenShade"); screenDim.setName("Sombra"); backMenuBttn = new CSprite(); backMenuBttn.setSortingLayer("TextUI"); tryAgainBttn = new CSprite(); tryAgainBttn.setSortingLayer("TextUI"); btnNextScreen = new CSprite(); btnNextScreen.setSortingLayer("TextUI"); optionsBttn = new CSprite(); optionsBttn.setImage(Resources.Load <Sprite>("Sprites/Buttons/Pause_Button")); optionsBttn.setXY(680, 40); optionsBttn.setSortingLayer("TextUI"); }
// Use this for initialization void Start() { var Ghost = GameObject.Find("Me"); if (Ghost.GetComponent<GhostController>() == null) { //This is not on the server, must be disabled this.enabled= false; } mySkillBar = Ghost.GetComponent<SkillBar>(); SpawnUI = transform.GetChild(3).gameObject; }
//--------------------------------------------------------------- void Start() { skillShotToPlay = GetSkillShotToPlay(); bIsShootingSkill = (skillShotToPlay.GetComponent <CharacterSkillShot>() != null); if (bIsShootingSkill) { playingSkillName = skillShotToPlay.GetComponent <CharacterSkillShot>().GetShotSkillName(); maxCoolDownTime = skillShotToPlay.GetComponent <CharacterSkillShot>().GetShotCoolDownSpeed(); shotPower = skillShotToPlay.GetComponent <CharacterSkillShot>().GetShotPower(); } else if (skillShotToPlay.GetComponent <SupportSkillShot>()) { playingSkillName = skillShotToPlay.GetComponent <SupportSkillShot>().GetShotSkillName(); maxCoolDownTime = skillShotToPlay.GetComponent <SupportSkillShot>().GetShotCoolDownSpeed(); shotPower = skillShotToPlay.GetComponent <SupportSkillShot>().GetShotPower(); bIsAutoSkill = skillShotToPlay.GetComponent <SupportSkillShot>().GetIsAutoSkill(); } skillCastingEffect = GameObject.FindGameObjectWithTag("Skill Casting Effect").GetComponent <SkillCastingFadeEffect>(); healthBar = transform.parent.GetComponentInChildren <HealthBar>(); skillBar = transform.parent.GetComponentInChildren <SkillBar>(); if (!healthBar || !skillBar) { Debug.Log("no health or skill bar found"); } if (GetComponent <Prisoner>()) { FindRendersToStandOut(); } skillCoolDownTime = maxCoolDownTime; //Hide shootable notification ToggleShootableNotif(false); needleAdjustTime = maxAdjustTime; //Init no prisoner use skill prisonerJustUsedSkill = null; //Creat a container for skill shot if (!GameObject.Find("Skill Shot Container")) { skillShotContainer = new GameObject("Skill Shot Container"); skillShotContainer.AddComponent <ClearUpChidren>(); } else { skillShotContainer = GameObject.Find("Skill Shot Container"); } }
/// Recreates the skill set based on the relevant factory. public virtual void Recreate() { // Clear all the skills. Skills.Clear(); // Get skills from factories and place them into the skill set. Call once after creating the cursor object at the start of combat. foreach (ModuleFactory module in GetComponents <ModuleFactory>()) { if (module.FactoryType == "Skill") { foreach (GameObject skill in module.Modules) { if (skill == null) { Debug.LogError("Skill is null"); } AddSkill(skill); } } } int offensiveIndex = 0; int defensiveIndex = 0; for (int i = 0; i < Skills.Count; i++) { // Makes the skill and gives passes a refence to the ship that this skill set belongs to. GameObject skill = Skills[i]; Ability abilityBase = skill.GetComponent <Ability>(); abilityBase.Ship = gameObject; // Adds GUI content for the palyer GameObject skillBar = Instantiate(SkillBarPrefab) as GameObject; SkillBar script = skillBar.GetComponent <SkillBar>(); script.OffensiveSkillCount = offensiveCount; script.DefensiveSkillCount = Skills.Count - offensiveCount; if (abilityBase.isOffensive) { script.SkillIndex = offensiveIndex++; } else { script.SkillIndex = defensiveIndex++; } // Contorller is a reference to the ability (the skills super class), which the GUI object reads from. script.Controller = abilityBase; script.Init(); } }
public void addEnemy(Enemy enemy, Vector3 pos) { Enemy e = (Enemy)Instantiate(enemy); enemies.Add(e); e.transform.position = pos; HpBar hbar = (HpBar)Instantiate(hpBar, e.transform); hbar.unit = e; SkillBar sbar = (SkillBar)Instantiate(skillBar, e.transform); sbar.unit = e; }
void Awake() { if (_instance == null) { _instance = this; } else if (_instance != null) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); unlockedDefensiveItems = new List <DefensiveItems> (); }
private void InitSkills() { _skills = new List <SkillInfo>(); int count = SavedData.GetAttackSkillsCount(); for (int i = 0; i < count; ++i) { int skillNumber = SavedData.GetAttackSkillAtPos(i); if (skillNumber != Constants.NONE) { SkillInfo skill = SkillBar.GetSkillForNumber(skillNumber); _skills.Add(skill); } } }
private void ChangeSkillBar() { GameObject newSkillBar = null; GameObject oldSkillBar = null; oldSkillBar = GetSkillBarById("first"); if (oldSkillBar == null) { return; } if (!m_IsSkillBarInitial) { m_SkillBarOriginalPos = oldSkillBar.transform.localPosition; m_IsSkillBarInitial = true; } if (this.transform.parent != null) { newSkillBar = GetSkillBarById("second"); if (newSkillBar == null) { newSkillBar = DashFire.ResourceSystem.GetSharedResource("UI/SkillBar") as GameObject; if (null == newSkillBar) { return; } if (this.transform.parent != null) { newSkillBar = NGUITools.AddChild(this.transform.parent.gameObject, newSkillBar); if (null != newSkillBar) { newSkillBar.transform.localPosition = oldSkillBar.transform.localPosition; SkillBar com = newSkillBar.GetComponent <SkillBar>(); if (com != null) { com.SetId("first"); } } } } } if (null == newSkillBar) { return; } SetSkillBarTween(oldSkillBar, newSkillBar); m_OldSkillBar = oldSkillBar; }
protected IEnumerator keepSpawningEnemy() { player = (Player)Instantiate(playerLiterace); player.mouseManager = mouseManager; HpBar hbar = (HpBar)Instantiate(hpBar, player.transform); hbar.unit = player; SkillBar sbar = (SkillBar)Instantiate(skillBar, player.transform); sbar.unit = player; while (true) { addEnemy(enemySoider, new Vector3(Random.Range(-2, 2), Random.Range(-2, 2), 0)); addEnemy(enemyArcher, new Vector3(Random.Range(-2, 2), Random.Range(-2, 2), 0)); yield return(new WaitForSeconds(3)); } }
public void Shutdown() { if (m_SkillBar != null) { m_SkillBar.ShutDown(); m_SkillBar = null; } m_Wonderful.ShutDown(); m_Gifteff.ShutDown(); m_DropItem.ShutDown(); m_MatchGuide.ShutDown(); m_LockedFishUI.ShutDown(); m_ChangeLauncherUI.ShutDown(); m_LotteryDraw.ShutDown(); m_SceneMatchRank.ShutDown(); GlobalHallUIMgr.Instance.GameShare.LveaveGame(); }
public void changeActiveToggle(SkillBar skillBar) { if (skill1 != skillBar) { skill1.DisableSkill(); } if (skill2 != skillBar) { skill2.DisableSkill(); } if (skill3 != skillBar) { skill3.DisableSkill(); } }
public void Awake() { canDrop = false; IsSpawnSkill = true; MinSpawnDist = 13f; MaxSpawnDist = 60f; key = KeyCode.Alpha2; mySkillBar = GetComponent<SkillBar>(); // ToolTip text ToolTip.Description = "Spawns Abomination.\nExplodes on contact."; ToolTip.FirstAttribute = "High"; ToolTip.SecondAttribute = "High"; ToolTip.ThirdAttribute = "Low"; }
public void Awake() { canDrop = false; IsSpawnSkill = true; MinSpawnDist = 10f; MaxSpawnDist = 60f; key = KeyCode.Alpha1; mySkillBar = GetComponent<SkillBar>(); // ToolTip text ToolTip.Description = "Spwans 2 Imps.\nAttacks on sight."; ToolTip.FirstAttribute= "Regular"; ToolTip.SecondAttribute = "Low"; ToolTip.ThirdAttribute = "Fast"; }
private void ChangeTab(int index) { Tools.ClearChildFromParent(scrollRect.content); List <SkillVo> skillList = new List <SkillVo>(); barList.Clear(); nowTab = index; int count = 0; if (index == 1) { for (int i = 0; i < DataManager.Instance.skillModel._dataList.Count; i++) { StaticSkillVo staticVo = StaticDataPool.Instance.staticSkillPool.GetStaticDataVo(DataManager.Instance.skillModel._dataList[i].id); if (staticVo.type == 1) { GameObject obj = Tools.CreateGameObject("UI/SkillPanel/SkillBar", scrollRect.content); SkillBar bar = obj.GetComponent <SkillBar>(); barList.Add(bar); bar.Create(DataManager.Instance.skillModel._dataList[i], ChangeSelect); count++; } } } else if (index == 2) { for (int i = 0; i < DataManager.Instance.skillModel._dataList.Count; i++) { StaticSkillVo staticVo = StaticDataPool.Instance.staticSkillPool.GetStaticDataVo(DataManager.Instance.skillModel._dataList[i].id); if (staticVo.type == 2) { GameObject obj = Tools.CreateGameObject("UI/SkillPanel/SkillBar", scrollRect.content); SkillBar bar = obj.GetComponent <SkillBar>(); barList.Add(bar); bar.Create(DataManager.Instance.skillModel._dataList[i], ChangeSelect); count++; } } } scrollRect.content.sizeDelta = new Vector2(scrollRect.content.sizeDelta.x, 150 * count); scrollRect.content.localPosition = Vector3.zero; }
public void Awake() { canDrop = false; key = KeyCode.Alpha4; mySkillBar = GetComponent<SkillBar>(); // ToolTip text ToolTip.Description = "Disguise an Explorer as an Imp."; ToolTip.FirstLabel = "Duration:"; ToolTip.FirstAttribute = HauntDuration.ToString() + "sec"; ToolTip.SecondLabel = "Cooldown:"; ToolTip.SecondAttribute = Cooldown.ToString() + "sec"; ToolTip.ThirdLabel = "Cost:"; ToolTip.ThirdAttribute = cost.ToString() + " MP"; }
public void Awake() { canDrop = false; IsSpawnSkill = true; MinSpawnDist = 10f; MaxSpawnDist = 100f; key = KeyCode.Alpha3; mySkillBar = GetComponent<SkillBar>(); // ToolTip text ToolTip.Description = "Spawns a Haunted Plant. Does not move."; ToolTip.FirstAttribute = "High"; ToolTip.SecondAttribute = "Regular"; ToolTip.ThirdLabel = "Cost:"; ToolTip.ThirdAttribute = cost.ToString() + " MP"; }
//结束时同时销毁OldPanel和OldSkillBar private void OnOldTweenFinished() { if (m_OldPanel != null) { DestroyImmediate(m_OldPanel); } if (m_OldSkillBar != null) { SkillBar skillBar = m_OldSkillBar.GetComponent <SkillBar>(); if (null != skillBar) { skillBar.UnSubscribe(); } DestroyImmediate(m_OldSkillBar); } //更换结束时、充值按钮使其可被点击 BoxCollider collider = this.GetComponent <BoxCollider>(); if (null != collider) { collider.enabled = true; } }
private void OnInitTimer(object sender, ElapsedEventArgs e) { ActionManager.Start(); KeyUtils.Start(); Inventory.Clear(); MouseOperations.Start(); _initTimer.Stop(); _updateTimer.Elapsed -= OnUpdate; _updateTimer.Stop(); ActionManager.SendAction(() => { WinUtils.ActivateWindow(Constants.KO_WINDOW); }, 0.3f, () => { int attempts = 0; SkillBar.Reset(); while (!SkillBar.IsInitialized && attempts++ < MAX_ATTEMPT_INITIALIZE_SKILLBAR) { SkillBar.InitSkillsInfo(); } if (SkillBar.IsInitialized) { _gos.ForEach(g => { g.Active = true; }); Started?.Invoke(); _sendStart = false; _updateTimer.Restart(); _updateTimer.Elapsed += OnUpdate; } else { Stop(); throw new Exception("Failed to initialize SkillBarManager, aborting."); } }); }
public override void OnEnter() { base.OnEnter(); _buffingInProgress = false; _currentBuff = null; if (_checkState == null) { _checkState = (CheckForBuffState)_sm.GetState(EState.CheckForBuff); _partyState = (CheckForPartyState)_sm.GetState(EState.CheckForParty); } if (!SavedData.UseBuffSkills) { FinishState(); return; } else { SkillBar.InitSkillsInfo(); _buffsToApply = _checkState.Buffs.Where((b) => { return(b.NeedsRefresh); }).ToList(); _buffsToApply.Sort(SortBuffs); ApplyFirstOrFinish(); } }
void Init() { _buffs = new List <BuffInfo>(); var buffs = SavedData.GetBuffSkills(); foreach (var buff in buffs) { if (buff.IsValid) { CTimer timer = new CTimer(); timer.AutoReset = false; timer.Interval = SkillBar.GetCooldownMinutesForSkill(buff.Skill) * 60 * 1000; timer.Elapsed += OnBuffExpired; BuffInfo info = new BuffInfo() { NeedsRefresh = true, Skill = buff.Skill, Timer = timer, UseOnParty = buff.UseOnParty }; _buffs.Add(info); } } }
void Start() { _ghostSkillBar = GetComponent<SkillBar>(); _ghostSkillBar.enabled = true; DomMngr.Instance.PointDominated += OnControlPointDominated; Cursor.SetCursor(mouseGhostDefault, new Vector2(mouseGhostDefault.width * 0.5f, mouseGhostDefault.height * 0.5f), CursorMode.Auto); }
void Awake() { hauntEtoM = false; _rb = GetComponent<Rigidbody2D>(); _health = GetComponent<Health>(); _avatarSkillBar = GetComponentInChildren<SkillBar>(); animator = GetComponent<RpcNetworkAnimator>(); avatarNB = GetComponent<AvatarNetworkBehavior>(); contanier = transform.Find("AvatarRotation"); // Game Balance Adjust => Makes Speed number comparable to Minion Speed number. CalcMoveSpeed = MoveSpeed / SpeedAdjust; slowDownMod = 1.0f; isHidden = false; }
public override void FillSkillBar() { SkillBar.AddSkillPoints(20); }
// Use this for initialization void Start() { //Load the saved players ability images into the skill bar playerSkillBar = new SkillBar(hudImages, coolDownText); playerSkillBar.LoadEquippedSkillImages(playerProfile); energySlider.maxValue = playerProfile.maxEnergy; corruptionSlider.maxValue = playerProfile.maxEnergy; energySlider.value = playerProfile.maxEnergy; corruptionSlider.value = 0; corruptManager = new CorruptionManager(); }