本文整理汇总了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" );
}
}
示例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;
}
示例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;
}
}