当前位置: 首页>>代码示例>>C#>>正文


C# Hero.SwitchToSyncPower方法代码示例

本文整理汇总了C#中Hero.SwitchToSyncPower方法的典型用法代码示例。如果您正苦于以下问题:C# Hero.SwitchToSyncPower方法的具体用法?C# Hero.SwitchToSyncPower怎么用?C# Hero.SwitchToSyncPower使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Hero的用法示例。


在下文中一共展示了Hero.SwitchToSyncPower方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
    }
开发者ID:julianstengaard,项目名称:TwinSpirits,代码行数:27,代码来源:SpiritSpeedBoost.cs

示例2: 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;
    }
开发者ID:julianstengaard,项目名称:TwinSpirits,代码行数:15,代码来源:SpiritPingPong.cs

示例3: 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;
    }
开发者ID:julianstengaard,项目名称:TwinSpirits,代码行数:18,代码来源:SpiritLightning.cs

示例4: 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;
    }
开发者ID:julianstengaard,项目名称:TwinSpirits,代码行数:19,代码来源:SpiritBungie.cs

示例5: 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;
    }
开发者ID:julianstengaard,项目名称:TwinSpirits,代码行数:20,代码来源:SpiritRegenHP.cs

示例6: 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;
    }
开发者ID:julianstengaard,项目名称:TwinSpirits,代码行数:21,代码来源:SpiritFire.cs

示例7: 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;
    }
开发者ID:julianstengaard,项目名称:TwinSpirits,代码行数:27,代码来源:SpiritImmortal.cs


注:本文中的Hero.SwitchToSyncPower方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。