本文整理汇总了C#中Enemy.ThinkAI方法的典型用法代码示例。如果您正苦于以下问题:C# Enemy.ThinkAI方法的具体用法?C# Enemy.ThinkAI怎么用?C# Enemy.ThinkAI使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Enemy
的用法示例。
在下文中一共展示了Enemy.ThinkAI方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChengeCard
/// <summary>
/// プレイヤー&CPUのカードの変更コルーチン
/// </summary>
/// <returns>The card.</returns>
/// <param name="player">If set to <c>true</c> player.</param>
IEnumerator ChengeCard(bool player)
{
int listn = 0;
int looping;
if(player == true){
int count = playerd.handCardList.Count;
looping = 0;
for(int i = 0;i<count;i++){
Vector3 cardVector = playerd.handCardList [i - looping].transform.position;
bool IsTouched = playerd.handCardList [i - looping].GetComponent<CardInfo> ().touched;
//Destroy (playerd.handCardList [i]);
if(IsTouched==false){
if(cardVector.x==-2.0){
listn = 0;
}else if(cardVector.x==-1.0){
listn = 1;
}else if(cardVector.x==0){
listn = 2;
}else if(cardVector.x==1.0){
listn = 3;
}else if(cardVector.x==2.0){
listn = 4;
}
//削除
Destroy (playerd.handCardList [listn - looping]);
playerd.removeListp (listn - looping);
//生成
int cardnum = Random.Range (0, fieldCardObj.Count);
GameObject card = (GameObject)Instantiate (fieldCardObj[cardnum], cardVector, Quaternion.identity);
card.name = ""+listn;
card.tag="PlayerCard";
card.transform.parent = PlayerParent.transform;
//キラカードの選定
int score = 0;
int kira = Random.Range (0, 15);
if(kira < 6){
card.GetComponent<CardInfo> ().isKira = true;
score += 5;
}else{
card.GetComponent<CardInfo>().StopParticleSystem();
}
Animator panim = card.GetComponent<Animator> ();
panim.SetBool ("CardAnim", true);
audioSource.PlayOneShot (audioClip);
int mark = card.GetComponent<CardInfo> ().Mark;
int cardn = card.GetComponent<CardInfo> ().Number;
if(cardn==1){
score += 14;
}else{
score += cardn;
}
playerd.handCardMark.RemoveAt(listn - looping);
playerd.handCardNum.RemoveAt(listn - looping);
playerd.handCardScore.RemoveAt(listn - looping);
playerd.addListp (card);
playerd.handCardMark.Add (mark);
playerd.handCardNum.Add (cardn);
playerd.handCardScore.Add (score);
fieldCardObj.RemoveAt (cardnum);
looping++;
yield return new WaitForSeconds(0.5f);
}
}
//ここから敵のチェンジの処理
//変数の初期化
listn = 0;
looping = 0;
enemyd = FindObjectOfType<Enemy>();
count = enemyd.EnemyCardNum.Count;
//タッチさせるためにスイッチで処理を分ける
switch(enemyd.ThinkAI()){
case 0:
//チェンジしない
foreach (GameObject obj in enemyd.EnemyCardObject) {
//.........这里部分代码省略.........