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


C# Fish.GetComponent方法代码示例

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


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

示例1: Handle_Change

    void Handle_Change( Fish f )
    {
        if(f.TypeIndex == MyFish.TypeIndex&&GameMain.State_ == GameMain.State.Normal&&!isChangGenerator)
        {
            MySwimmer = f.GetComponent<Swimmer>( );
            //Debug.Log( "inchang" );
            iSp = MySwimmer.Speed;

            StartCoroutine( "Waite" );

        }
    }
开发者ID:minh3d,项目名称:Fish,代码行数:12,代码来源:ChangeFishGenerator.cs

示例2: Func_GetFishOddAdditive

    HitProcessor.OperatorOddFix Func_GetFishOddAdditive(Player killer, Bullet b, Fish f, Fish fCauser)
    {
        if (fCauser.HittableTypeS == "SameTypeBomb")//��������ͬ��ը��.����������С��,��ʹû�д�FishEx_OddsMulti,Ҳ��Ҫ�˱�
        {
            FishEx_OddsMulti cpOddMulti = fCauser.GetComponent<FishEx_OddsMulti>();

            if (cpOddMulti == null || cpOddMulti.OddsMulti == 1)
                return null;

            return new HitProcessor.OperatorOddFix(HitProcessor.Operator.LastModule, cpOddMulti.OddsMulti);
        }
        else if (f.HittableTypeS == "SameTypeBomb")//�п��ܳ���causer��SameTypeBombEx,��ΪSameTypeBombEx����SameTypeBomb�Ĵ�����
        {
            FishEx_OddsMulti cpOddMulti = f.GetComponent<FishEx_OddsMulti>();

            if (cpOddMulti == null || cpOddMulti.OddsMulti == 1)
                return null;

            return new HitProcessor.OperatorOddFix(HitProcessor.Operator.LastModule, cpOddMulti.OddsMulti);
        }

        return null;
    }
开发者ID:minh3d,项目名称:Fish,代码行数:23,代码来源:Module_FishTypeBomb2.cs

示例3: _Coro_LockProcess

    IEnumerator _Coro_LockProcess(Fish tarFish)
    {
        Spr_TargetMoving.renderer.enabled = true;
        Spr_Target.renderer.enabled = false;

        Transform tsTarFish = tarFish.transform;
        //Vector3 offsetLock;
        //mFishPosOffsetBuff.TryGetValue(tarFish.TypeIndex, out offsetLock);
        FishEx_LockPos fishLockLocal = tarFish.GetComponent<FishEx_LockPos>();

        float movePercent = 1F;//vecPercent = 1 - movePercent ^ 2;//mp��������
        Vector3 startPos = TsTargeter.position;
        startPos.z = mDepth;

        while (true)
        {

            if (tarFish == null
                || !tarFish.Attackable
                || !mChangeTargetArea.Contains(fishLockLocal!=null?fishLockLocal.LockPos:tsTarFish.position))
            {

                Fish f = Lock();
                if (f != null)
                {
                    if (EvtRelock != null)
                        EvtRelock(f, mPlayer);
                }
                else
                {
                    UnLock();
                }
                yield break;
            }

            Vector3 tarVec = (fishLockLocal != null ? fishLockLocal.LockPos : tsTarFish.position) - startPos;
            tarVec.z = 0F;

            float vecPercent = 1F - movePercent*movePercent;
            movePercent -= MoveSpd * Time.deltaTime;

            TsTargeter.position = startPos + tarVec * vecPercent;

            if (movePercent < 0F)
            {
                Spr_TargetMoving.renderer.enabled = false;
                Spr_Target.renderer.enabled = true;
                break;
            }
            yield return 0;
        }
        //Debug.Log("_Coro_LockProcess2" + tarFish.name);
        Vector3 tmpVec3;

        if (EvtTargetOnFish != null)
            EvtTargetOnFish(tarFish,mPlayer);
        //Quaternion rotateOri = Quaternion.AngleAxis(180F, Vector3.forward);
        float processPercent = 0F;
        Transform tsSpr_Target = Spr_Target.transform;
        while (true)
        {
            if (tarFish == null
                || !tarFish.Attackable
                || !mChangeTargetArea.Contains(fishLockLocal != null ? fishLockLocal.LockPos : tsTarFish.position))
            {
                Fish f = Lock();
                if (f != null)
                {
                    if (EvtTargetLeaveFish != null)
                        EvtTargetLeaveFish();
                    if (EvtRelock != null)
                        EvtRelock(f, mPlayer);
                }
                else
                {
                    UnLock();
                }
                yield break;
            }

            tmpVec3 = fishLockLocal != null ? fishLockLocal.LockPos : tsTarFish.position;
            tmpVec3.z = mDepth;
            TsTargeter.position = tmpVec3;

            tsSpr_Target.rotation = Quaternion.AngleAxis( Mathf.Cos(Mathf.PI * 2F * processPercent)*25F, Vector3.forward);
            processPercent += Time.deltaTime * 0.5F;

            yield return 0;
        }
    }
开发者ID:minh3d,项目名称:Fish,代码行数:90,代码来源:Player_FishLocker.cs


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