Commit 9b3ef7b0 authored by Ruidong's avatar Ruidong

Merge branch 'master' of gitlab.dy-space.com:czy/stockrunning

parents 999c5bee 54d89020
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -66,10 +66,6 @@ public class AIMove : MonoBehaviour ...@@ -66,10 +66,6 @@ public class AIMove : MonoBehaviour
{ {
this.SpeedLevel--; this.SpeedLevel--;
} }
}else if (other.tag == "Prop" && DoRanking._instance.rankingList[2] != gameObject)
{
print("出现怪。目标:" + DoRanking._instance.rankingList[2].name);
Destroy(other.gameObject);
} }
} }
private void OnCollisionExit(Collision other) private void OnCollisionExit(Collision other)
...@@ -363,12 +359,12 @@ public class AIMove : MonoBehaviour ...@@ -363,12 +359,12 @@ public class AIMove : MonoBehaviour
//} //}
public void Vertigo(float time) public void Vertigo(float time)
{ {
if (time > timerVertigo) //if (time > timerVertigo)
{ //{
timerVertigo = time; //不累加时长,单会更新时长。 // timerVertigo = time; //不累加时长,单会更新时长。
} //}
//timerVertigo += time; //累加眩晕时长 timerVertigo += time; //累加眩晕时长
} }
private void OnControllerColliderHit(ControllerColliderHit hit)//需要写到enemy中。 private void OnControllerColliderHit(ControllerColliderHit hit)//需要写到enemy中。
......
...@@ -78,11 +78,11 @@ public class PlayerMove : MonoBehaviour ...@@ -78,11 +78,11 @@ public class PlayerMove : MonoBehaviour
this.SpeedLevel--; this.SpeedLevel--;
} }
} }
else if (other.tag == "Prop" && DoRanking._instance.rankingList[2]!=gameObject) //自己不是最前面的人。 //else if (other.tag == "Prop" && DoRanking._instance.rankingList[2]!=gameObject) //自己不是最前面的人。
{ //{
print("出现怪。目标:"+DoRanking._instance.rankingList[2].name); // print("出现怪。目标:"+DoRanking._instance.rankingList[2].name);
Destroy(other.gameObject); // Destroy(other.gameObject);
} //}
} }
......
fileFormatVersion: 2 fileFormatVersion: 2
guid: ed5d1b779680c74429ccd8efa73d6bca guid: f6eb4154a00d3a342a58544cb786d48c
PrefabImporter: folderAsset: yes
DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:
assetBundleName: assetBundleName:
......
...@@ -15,12 +15,13 @@ public class Enemy_Vertigo : MonoBehaviour ...@@ -15,12 +15,13 @@ public class Enemy_Vertigo : MonoBehaviour
void Start() void Start()
{ {
characterController = this.GetComponent<CharacterController>(); characterController = this.GetComponent<CharacterController>();
targetPos = DoRanking._instance.rankingList[2].transform;
} }
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
targetPos = DoRanking._instance.rankingList[2].transform;
Vector3 direction = (targetPos.position - transform.position); Vector3 direction = (targetPos.position - transform.position);
direction.y = 0; direction.y = 0;
direction = direction.normalized; direction = direction.normalized;
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Prop : MonoBehaviour
{
public GameObject enemy3AI;
void Start()
{
}
// Update is called once per frame
void Update()
{
}
private void OnTriggerEnter(Collider other)
{
if ((other.tag == "Competitor" || other.tag == "Player") && DoRanking._instance.rankingList[2] != other.gameObject)
{
//print(DoRanking._instance.rankingList[2].name + "---" + other.gameObject.name+" "+ (DoRanking._instance.rankingList[2]== other.gameObject).ToString());
enemy3AI.transform.position = DoRanking._instance.rankingList[2].transform.position+new Vector3(0,0,100);
enemy3AI.SetActive(true);
Destroy(gameObject);
}
//else if (other.tag == "Player" && DoRanking._instance.rankingList[2] != other.gameObject)
//{
// transform.position = other.gameObject.transform.position + new Vector3(0, 0, 100);
// enemy3AI.SetActive(true);
// Destroy(gameObject);
//}
}
}
fileFormatVersion: 2
guid: 50a9bfefc266bf648be274dc28466693
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment