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


C# Fish.Kill方法代码示例

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


在下文中一共展示了Fish.Kill方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: On_FishExDragonSlayerTouchFish

    private Dictionary<int, Fish> mSlayFishCache; //�ɱ�ɱ����cache,��Prefab_SlayFish����

    #endregion Fields

    #region Methods

    /// <summary>
    /// ��FishEx_DragonSlayer�ص�(�����¼���������)
    /// </summary>
    /// <param name="ds"></param>
    /// <param name="owner"></param>
    public void On_FishExDragonSlayerTouchFish(FishEx_DragonSlayer ds, Fish fishTouched,Player owner)
    {
        //�Ӵ�����fish�Ѿ�����
        if (fishTouched == null || !fishTouched.Attackable)
            return;

        if (!mSlayFishCache.ContainsKey(fishTouched.TypeIndex))
            return;
        //*Ϊ�˵��ú�������һ����ʱ��bullet,�dz�Ż��,����û�취,��Ϊ�ܶ�ط�ʹ���������.�Ժ���Ҫע���¼�,���ú�����д��
        GameObject tmpBulletGo = new GameObject();
        Bullet b = tmpBulletGo.AddComponent<Bullet>();
        b.FishOddsMulti = 1;
        b.Score = DragonSlayerScores[owner.Idx].Val;

        fishTouched.Kill(owner, b, 0F);

        owner.GainScore(fishTouched.Odds * DragonSlayerScores[owner.Idx].Val
            , fishTouched.Odds
            , DragonSlayerScores[owner.Idx].Val
            );

        //ɾ��֮ǰ������
        Destroy(tmpBulletGo);

        //dragonSlayerScore����
        DragonSlayerScores[owner.Idx].Val = 0;

        //ɾ��dragonSlayer
        ds.Clear();

        //������
        GameObject efGo = Instantiate(Ef_DragonKilled) as GameObject;
        Vector3 worldPos = fishTouched.transform.position;
        worldPos.z = Defines.GlobleDepth_BombParticle;
        efGo.transform.position = worldPos;
    }
开发者ID:minh3d,项目名称:Fish,代码行数:47,代码来源:DragonSlayer.cs

示例2: Process_FreezeBomb

    static void Process_FreezeBomb(Bullet b, Fish fishFirst)
    {
        //Debug.Log("Process_FreezeBomb");
        if (!fishFirst.Attackable)
            return;
        //GameMain gm = GameMain.Singleton;
        //Transform bulletTs = b.transform;
        Player bulletOwner = b.Owner;
        bool IsLockFishBullet = b.IsLockingFish;

        //�������ը���Ƿ�ը
        int oddForDieRatio = GetFishOddForDieRatio(bulletOwner, b, fishFirst,fishFirst);
        FishOddsData freezeBomb = new FishOddsData(0, oddForDieRatio);//fishFirst.Odds + GetFishOddForDieRatio(bulletOwner, b, fishFirst,fishFirst));//�������ʼ���

        List<FishOddsData> lstBombDie = GameOdds.OneBulletKillFish(b.Score, freezeBomb, new List<FishOddsData>());

        if (Evt_Hit != null)
            Evt_Hit(oddForDieRatio == 0 ? true : false, bulletOwner, b, fishFirst);

        if (lstBombDie.Count == 0)//����ը
        {
            return;
        }

        fishFirst.Kill(bulletOwner, b, 0F);//0.5����

        //BackStageSetting bss = gm.BSSetting;
        fishFirst.OddBonus = GetFishOddBonus(bulletOwner, b, fishFirst, fishFirst);
        int scoreTotalGetted = b.Score * fishFirst.OddBonus;

        if (scoreTotalGetted != 0)
        {
            bulletOwner.GainScore(scoreTotalGetted);
            if (GameMain.Evt_PlayerGainScoreFromFish != null)
                GameMain.Evt_PlayerGainScoreFromFish(bulletOwner, scoreTotalGetted, fishFirst, b);

            //����ɱ���������¼�
            if (IsLockFishBullet && GameMain.EvtKillLockingFish != null)
                GameMain.EvtKillLockingFish(bulletOwner);
        }

        GameMain.IsMainProcessPause = true;

        if (GameMain.EvtFreezeBombActive != null)
            GameMain.EvtFreezeBombActive();

        GameObject go = new GameObject("Delay_FreezeBombRecover");
        go.AddComponent<FreezeBombRecover>();

        if (Evt_HitResult != null)
            Evt_HitResult(!fishFirst.Attackable, bulletOwner, b, fishFirst);
    }
开发者ID:minh3d,项目名称:Fish,代码行数:52,代码来源:HitProcessor.cs

示例3: Process_AreaBomb

    static void Process_AreaBomb(Bullet b, Fish fishFirst)
    {
        if (!fishFirst.Attackable)
            return;

        Transform bulletTs = b.transform;
        Player bulletOwner = b.Owner;
        bool IsLockFishBullet = b.IsLockingFish;

        //������ײ��Χ
        RaycastHit[] results = Physics.SphereCastAll(bulletTs.position - Bullet.ColliderOffsetZ, fishFirst.AreaBombRadius, Vector3.forward);

        //�����Ƿ�ը
        List<Fish> fishAffect = new List<Fish>();
        int oddTotal = 0;//���ڽ����ı���
        int oddTotalForCaclDieratio = 0;//�����������ʵı���

        Fish tmpFish = null;

        foreach (RaycastHit hitObj in results)
        {
            tmpFish = hitObj.transform.GetComponent<Fish>();
            if (tmpFish != null
                && tmpFish.Attackable
                && tmpFish.HittableTypeS == "Normal")
            {
                fishAffect.Add(tmpFish);

                oddTotalForCaclDieratio += GetFishOddForDieRatio(bulletOwner, b, tmpFish,fishFirst);//�������ʼ���;
                tmpFish.OddBonus = GetFishOddBonus(bulletOwner, b, tmpFish, fishFirst);
                oddTotal += tmpFish.OddBonus;
            }

            if (oddTotal > fishFirst.AreaBombOddLimit)
                break;
        }

        FishOddsData dataBomb = new FishOddsData(0, oddTotalForCaclDieratio);
        List<FishOddsData> lstBombDie = GameOdds.OneBulletKillFish(b.Score, dataBomb, new List<FishOddsData>());

        if (Evt_Hit != null)
            Evt_Hit(oddTotalForCaclDieratio == 0 ? true : false, bulletOwner, b, fishFirst);

        if (lstBombDie.Count == 0)//����ը
        {
            return;
        }

        fishFirst.Kill(bulletOwner, b, 0);
        //ը����ը��ɱ��Χ����
        int scoreTotalGetted = oddTotal * b.Score;

        //�����¼�
        if (GameMain.EvtFishBombKilled != null)
            GameMain.EvtFishBombKilled(bulletOwner, scoreTotalGetted);

        //�ɱ�Ч��(����������)
        foreach (Fish fDie in fishAffect)
        {
            fDie.Kill(bulletOwner, b, 0F);//0.5����
        }

        //BackStageSetting bss = GameMain.Singleton.BSSetting;

        if (scoreTotalGetted != 0)
        {
            bulletOwner.GainScore(scoreTotalGetted);

            if (GameMain.Evt_PlayerGainScoreFromFish != null)
                GameMain.Evt_PlayerGainScoreFromFish(bulletOwner, scoreTotalGetted, fishFirst, b);

            //����ɱ���������¼�
            if (IsLockFishBullet && GameMain.EvtKillLockingFish != null)
                GameMain.EvtKillLockingFish(bulletOwner);

        }

        if (Evt_HitResult != null)
            Evt_HitResult(!fishFirst.Attackable, bulletOwner, b, fishFirst);
    }
开发者ID:minh3d,项目名称:Fish,代码行数:80,代码来源:HitProcessor.cs


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