//clickNumber: some skills need to be used more than once [for instance 'smokeTeleport'] public void performSkill(Character character, int skill, Vector3 mousePos, Character targetCharacter) { if (skill == Constants.bomb) { GameObject newBomb = Instantiate(bombPrefab, character.transform.position, Quaternion.identity) as GameObject; newBomb.transform.parent = character.transform; BombSkill bomb = newBomb.GetComponent <BombSkill>(); bomb.setParameters(character, mousePos); bomb.startSkill(); } else if (skill == Constants.smokeTeleport) { SmokeTeleport smoke = character.GetComponentInChildren <SmokeTeleport>(); if (smoke == null) { GameObject newSmoke = Instantiate(smokePrefab, character.transform.position, Quaternion.identity) as GameObject; newSmoke.transform.parent = character.transform; smoke = newSmoke.GetComponent <SmokeTeleport>(); smoke.setParameters(character, mousePos); smoke.startSkill(); } else { smoke.setParameters(character, mousePos); smoke.secondCast(); } } else if (skill == Constants.magicMirror) { GameObject newMagicMirror = Instantiate(magicMirrorPrefab, character.transform.position, Quaternion.identity) as GameObject; newMagicMirror.transform.parent = character.transform; MagicMirror mm = newMagicMirror.GetComponent <MagicMirror>(); mm.setParameters(character); mm.startSkill(); } else if (skill == Constants.earthquake) { GameObject newEarthquake = Instantiate(earthquakePrefab, character.transform.position, Quaternion.identity) as GameObject; newEarthquake.transform.parent = character.transform; EarthquakeSkill earthquake = newEarthquake.GetComponent <EarthquakeSkill>(); earthquake.setParameters(character, mousePos); earthquake.startSkill(); } else if (skill == Constants.heal) { GameObject newHeal = Instantiate(healPrefab, character.transform.position, Quaternion.identity) as GameObject; newHeal.transform.parent = character.transform; HealSkill heal = newHeal.GetComponent <HealSkill>(); heal.setParameters(character, targetCharacter); heal.startSkill(); } else if (skill == Constants.fireball) { GameObject newFireball = Instantiate(fireballPrefab, character.transform.position, Quaternion.identity) as GameObject; newFireball.transform.parent = character.transform; FireballSkill fireball = newFireball.GetComponent <FireballSkill>(); fireball.setParameters(character, mousePos); fireball.startSkill(); } }
public void cancelSkill(Skill skill) { int n = skill.getSkillNumber(); if (n == Constants.bomb) { BombSkill bomb = skill.GetComponent <BombSkill>(); bomb.cancelSkill(); } if (n == Constants.smokeTeleport) { SmokeTeleport smoke = skill.GetComponent <SmokeTeleport>(); smoke.cancelSkill(); } if (n == Constants.magicMirror) { MagicMirror magic = skill.GetComponent <MagicMirror>(); magic.cancelSkill(); } if (n == Constants.earthquake) { EarthquakeSkill earthquake = skill.GetComponent <EarthquakeSkill>(); earthquake.cancelSkill(); } if (n == Constants.fireball) { FireballSkill fireball = skill.GetComponent <FireballSkill>(); fireball.cancelSkill(); } }
private IEnumerator WaitForProvider() { while (Provider == null) { yield return(WaitFor.EndOfFrame); } mirror = Provider.GetComponent <MagicMirror>(); }
/// <summary> /// 初始化设置 /// </summary> private void InitSettings() { //初始化设置信息 Static.Settings.ReadSettings(); Static.FileIndexPath = Static.Settings.FileIndexPath; Static.MP3IndexPath = Static.Settings.MP3IndexPath; IndexInfoDB indexInfo = new IndexInfoDB(); indexInfo.ReadIndexInfoDB(); Static.MP3Artist = indexInfo.MP3Artist; Static.MP3SongNums = indexInfo.MFileNums; this.停止更新ToolStripMenuItem.Enabled = false; this.保存结果ToolStripMenuItem.Enabled = false; this.tsslLength = this.statusStrip.Width - 120; this.orginalStatusText = "永远别说永远,凡事都有可能。"; this.tsslStatus.Text = Deal.LimitStringLength(this.orginalStatusText, this.tsslLength); this.modeStatus = ModeStatus.FILE; this.magicMirrorStatus = MagicMirrorStatus.Close; this.lvStatus = ListViewStatus.File; this.isSearchWithResult = false; this.indexMode = IndexMode.All; //默认索引模式为所有 this.searchMode = SearchMode.File; //默认搜索模式为文件 //this.index = new Index(this, this.indexMode); this.search = new Search(this, this.searchMode); this.magicMirror = new MagicMirror(); this.magicMirror.SetProperties(MagicMode.None, null); this.pnlMagicMirror.Controls.Add(this.magicMirror); this.magicMirror.Dock = DockStyle.Fill; this.btnNext.Visible = false; this.btnPrevious.Visible = false; this.tsslPages.Visible = false; //加入文件夹图标,未知文件的图标,mp3图标,jpg图标。 this.imgIcon.Images.Add("f", GetSystemIcon.GetFolderIcon(false)); this.imgIcon.Images.Add("u", GetSystemIcon.GetUnknownFileIcon(false)); this.imgIcon.Images.Add(".mp3", GetSystemIcon.GetIconByFileType(".mp3", false)); this.imgIcon.Images.Add(".jpg", GetSystemIcon.GetIconByFileType(".jpg", false)); this.imgIcon.Images.Add(".txt", GetSystemIcon.GetIconByFileType(".txt", false)); this.imgIcon.Images.Add("artist", Properties.Resources.artist); }