new_10007_YanCheng_Metrology/Assets/Scripts/Player10007_7002.cs

55 lines
1.8 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Player10007_7002 : SingletonMono<Player10007_7002>
{
public int moveNum = 0;
public Vector3 lastMovePos = new Vector3(0, 0, 0);
public List<GameObject> cdzList = new List<GameObject>();
public bool isNearCDZ = false;
private void Start()
{
isNearCDZ = false;
}
private void Update()
{
if (lastMovePos != this.transform.localPosition)
{
lastMovePos = this.transform.localPosition;
moveNum++;
if (moveNum == 500)
{
//Debug.LogError("巡视OK");
//GameManager.ProcessMgr.CheckSubProcessSteps(GameManager.ProcessMgr.subProcessStepId);
if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID("巡视场站", true) == 0)
{
ScoreManager.instance.Check("巡视场站", "");
Debug.Log("巡视场站OK");
}
}
}
//Debug.LogError(GameManager.ProcessMgr.subProcessStepId);
if (!isNearCDZ && Score_7002.cdzIndex == 1)
{
int len = cdzList.Count;
//isNearCDZ = false;
for (int i = 0; i < len; i++)
{
if (Vector3.Distance(cdzList[i].transform.position, this.transform.position) < 5f)
{
isNearCDZ = true;
//Debug.LogError("充电桩附近");
if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID("巡视充电桩", true) == 0)
{
ScoreManager.instance.Check("巡视充电桩", "");
Debug.Log("巡视充电桩OK");
}
break;
}
}
}
}
}