本文整理汇总了C#中Hero.ChangeSpiritAmount方法的典型用法代码示例。如果您正苦于以下问题:C# Hero.ChangeSpiritAmount方法的具体用法?C# Hero.ChangeSpiritAmount怎么用?C# Hero.ChangeSpiritAmount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hero
的用法示例。
在下文中一共展示了Hero.ChangeSpiritAmount方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnActivateSync
public override IEnumerator OnActivateSync(Hero sourceHero, Hero otherHero, bool secondSync = true)
{
//Debug.Log("Activating" + this.GetType() + " SYNC POWER!");
if (!secondSync)
{
//Pay for activation
sourceHero.ChangeSpiritAmount(-costActivateSync);
otherHero.ChangeSpiritAmount(-costActivateSync);
//Stop other Heros effect
otherHero.SwitchToSyncPower();
}
//Find enemies to do effect on
GameObject[] enemies = GameObject.FindGameObjectsWithTag("Enemy");
enemiesToSlow = new BaseUnit[enemies.Length];
for (int i = 0; i < enemies.Length; i++)
{
enemiesToSlow[i] = enemies[i].GetComponent<BaseUnit>();
enemiesToSlow[i].SetMovementSpeedBuff(-spiritSyncSlow);
}
StartCoroutine(OnDeactivateSync(sourceHero, otherHero));
return null;
}
示例2: Collected
public override void Collected(Hero collector)
{
if (_collected == true) return;
_collected = true;
gameObject.collider.enabled = false;
gameObject.audio.clip = SpiritPickupSound;
gameObject.audio.Play();
collector.ChangeSpiritAmount(2);
gameObject.renderer.enabled = false;
for (int i = 0; i < gameObject.transform.childCount; i++) {
gameObject.transform.GetChild(i).gameObject.SetActive(false);
}
Destroy(gameObject, SpiritPickupSound.length);
}
示例3: OnActivateSync
public override IEnumerator OnActivateSync(Hero sourceHero, Hero otherHero, bool secondSync = false)
{
DestroyBall();
if (!secondSync) {
//Stop other Heros effect
otherHero.SwitchToSyncPower();
//Pay for activation
sourceHero.ChangeSpiritAmount(-costActivateSync);
otherHero.ChangeSpiritAmount(-costActivateSync);
}
InstantiateBall(otherHero, sourceHero, true);
return null;
}
示例4: OnActivateSync
public override IEnumerator OnActivateSync(Hero sourceHero, Hero otherHero, bool secondSync = false)
{
if (_currentLightning != null) {
GameObject.Destroy(_currentLightning);
}
if (!secondSync) {
//Stop other Heros effect
otherHero.SwitchToSyncPower();
//Pay for activation
sourceHero.ChangeSpiritAmount(-costActivateSync);
otherHero.ChangeSpiritAmount(-costActivateSync);
}
LightningSync(sourceHero, otherHero);
return null;
}
示例5: OnActivateSync
public override IEnumerator OnActivateSync(Hero sourceHero, Hero otherHero, bool secondSync = false)
{
//Debug.Log("Activating" + this.GetType() + " SYNC POWER!");
//Only allow one of these per person
if (circleActive)
return null;
if (!secondSync) {
//Stop other Heros effect
otherHero.SwitchToSyncPower();
//Pay for activation
sourceHero.ChangeSpiritAmount(-costActivateSync);
otherHero.ChangeSpiritAmount(-costActivateSync);
}
StartCoroutine(DeathRay(sourceHero, otherHero));
return null;
}
示例6: OnActivateSync
public override IEnumerator OnActivateSync(Hero sourceHero, Hero otherHero, bool secondSync = false)
{
//Debug.Log("Activating" + this.GetType() + " SYNC POWER!");
if (!secondSync)
{
//Pay for activation
sourceHero.ChangeSpiritAmount(-costActivateSync);
otherHero.ChangeSpiritAmount(-costActivateSync);
//Stop other Heros effect
otherHero.SwitchToSyncPower();
}
//Heal both players
otherHero.Heal(regenPerSync);
sourceHero.Heal(regenPerSync);
return null;
}
示例7: OnActivateSync
public override IEnumerator OnActivateSync(Hero sourceHero, Hero otherHero, bool secondSync = false)
{
//Debug.Log("Activating" + this.GetType() + " SYNC POWER!");
if (!secondSync) {
//Stop other Heros effect
otherHero.SwitchToSyncPower();
//Pay for activation
sourceHero.ChangeSpiritAmount(-costActivateSync);
otherHero.ChangeSpiritAmount(-costActivateSync);
}
//Find enemies to do effect on
_enemiesGO = GameObject.FindGameObjectsWithTag("Enemy");
var center = (sourceHero.transform.position + otherHero.transform.position) * 0.5f;
StartCoroutine(CreateSyncExplosion(center));
return null;
}
示例8: OnActivateSync
public override IEnumerator OnActivateSync(Hero sourceHero, Hero otherHero, bool secondSync = false)
{
//Debug.Log("Activating" + this.GetType() + " SYNC POWER!");
/*if (triggerP1 != null) {
Destroy(triggerP1.gameObject);
}
if (triggerP2 != null) {
Destroy(triggerP2.gameObject);
}*/
//This cant be used twice
/*if (secondSync && otherHero.currentSpiritPower.GetType() == typeof(SpiritImmortal))
return null;*/
if (!secondSync) {
//Stop other Heros effect
otherHero.SwitchToSyncPower();
//Pay for activation
sourceHero.ChangeSpiritAmount(-costActivateSync);
otherHero.ChangeSpiritAmount(-costActivateSync);
}
readyToPull = true;
ThrowGravityTriggers(sourceHero, otherHero);
return null;
}