public void Play(UISkillButton parent) { //IL_009c: Unknown result type (might be due to invalid IL or missing references) isActive = true; if (obj != null) { obj.SetActive(true); } if (alpha != null) { alpha.ResetToBeginning(); alpha.PlayForward(); } if (scale != null) { scale.ResetToBeginning(); scale.PlayForward(); } if (work != null) { parent.StopCoroutine(work); } work = EndCheck(); parent.StartCoroutine(work); }
private void InitButtons() { while (0 < skill_button_spot.childCount) { Destroy(skill_button_spot.GetChild(0).gameObject); skill_button_spot.GetChild(0).transform.SetParent(null); } GameManager.Instance.player.RemoveSkill(Skill_Runaway.SKILL_ID); skill_button_spot.gameObject.SetActive(true); skill_buttons = new List <UISkillButton>(); foreach (var itr in GameManager.Instance.player.skills) { if (Skill.TriggerType.Passive == itr.Value.skill_data.meta.trigger_type) { continue; } UISkillButton skillButton = GameObject.Instantiate <UISkillButton>(skill_button_prefab); Skill skill = itr.Value.skill_data; skillButton.Init(skill, () => { if (0 < skill.cooltime) { SceneDungeon.log.Write("can not use skill"); return; } GameManager.Instance.player.current_skill = skill; skill.cooltime = skill.meta.cooltime; skillButton.skill_icon.fillAmount = 0.0f; }); skill_buttons.Add(skillButton); skillButton.transform.SetParent(skill_button_spot, false); } runaway_button.gameObject.SetActive(true); GameManager.Instance.player.AddSkill(SkillManager.Instance.FindMeta <Skill_Runaway.Meta>(Skill_Runaway.SKILL_ID).CreateInstance()); { Skill skill = GameManager.Instance.player.skills[Skill_Runaway.SKILL_ID].skill_data; runaway_button.Init(skill, () => { if (0 < skill.cooltime) { SceneDungeon.log.Write("can not use skill"); return; } GameManager.Instance.player.current_skill = skill; skill.cooltime = skill.meta.cooltime; runaway_button.skill_icon.fillAmount = 0.0f; }); skill_buttons.Add(runaway_button); } }
public BattleResult battle_result = BattleResult.Invalid; // 0 : lose, 1 : win, 2 : draw private void Awake() { dungeon = UIUtil.FindChild <Dungeon>(transform, "../Dungeon"); monster = UIUtil.FindChild <Monster>(transform, "Monster"); player_damage_effect_spot = UIUtil.FindChild <Transform>(transform, "../UI/BattleEffect"); player_health = UIUtil.FindChild <UIGaugeBar>(transform, "../UI/Player/Health"); skill_button_spot = UIUtil.FindChild <Transform>(transform, "../UI/Battle/SkillButtons"); runaway_button = UIUtil.FindChild <UISkillButton>(transform, "../UI/Dungeon/SideButtons/RunawayButton"); touch_input = GetComponent <TouchInput>(); if (null == touch_input) { throw new MissingComponentException("TouchInput"); } touch_input.block_count++; }
public void Init(UISkillButton parent) { if (work != null) { parent.StopCoroutine(work); work = null; } if (isActive) { isActive = false; if (obj != null) { obj.SetActive(false); } } }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); /* * Load content for the "game" state */ //Load the background UIBox background = new UIBox(GameBoard.game, 0, 0, this.gameWidth, this.gameHeight); background.thisSprite = Content.Load <Texture2D>(@"Images/background"); background.layer = 100; background.visible = true; background.mouseEvents = false; //Create a new UIGrid this.UIGrid = new UIGrid(Grid.mainGrid); //Pass that grid to the UnitManager object UnitManager.Manager.UIGrid = this.UIGrid; //Load grid textures UIGridCell.Load(Content); //Load health bar textures UIHealthBar.Load(Content); //Load moves left textures UIMovesLeft.Load(Content); //Load the active unit UI textures UIStatBackground.Load(Content); UITextBox.Load(Content); UISkillButton.Load(Content); UIDefaultActionButton.Load(Content); //Load UIUnit textures for (int p = 0; p < playList.Count; p++) { for (int i = 0; i < playList[p].Units.Count; i++) { playList[p].Units[i].sprite.Load(Content); } } //rock.sprite.Load(Content); /* * Load content for the "teamSelect" state */ /* * Load content for the "startMenu" state */ //Load the background UIBox startMenuBackground = new UIBox(GameBoard.startMenu, 0, 0, this.windowWidth, this.windowHeight); startMenuBackground.thisSprite = Content.Load <Texture2D>(@"Images/TitleScreen/titleScreenBackground"); startMenuBackground.layer = 100; startMenuBackground.visible = true; startMenuBackground.mouseEvents = false; startMenuBackground.viewMove = false; //Load the start button UIStartButton startButton = new UIStartButton(GameBoard.startMenu, (this.windowWidth - 672) / 2, (this.windowHeight - 217) / 2, 672, 217); UIStartButton.Load(Content); startButton.layer = 99; startButton.visible = true; startButton.viewMove = false; /* * Load content for the 'endMenu' state */ UIBox endMenuBackground = new UIBox(GameBoard.endMenu, 0, 0, this.windowWidth, this.windowHeight); endMenuBackground.thisSprite = Content.Load <Texture2D>(@"Images/EndScreen/endScreenBackground"); endMenuBackground.layer = 100; endMenuBackground.visible = true; endMenuBackground.mouseEvents = false; endMenuBackground.viewMove = false; //Load the exit button UIExitButton exitButton = new UIExitButton(GameBoard.endMenu, (this.windowWidth - 672) / 2, ((this.windowHeight - 217) / 2) + 150, 672, 217); UIExitButton.Load(Content); exitButton.layer = 99; exitButton.visible = true; exitButton.viewMove = false; //Load other content here //Load fonts GameBoard.font = Content.Load <SpriteFont>("Fonts/dosis"); }