最近的高粱高粱
This commit is contained in:
parent
a7a34958ed
commit
5585f90ff1
|
|
@ -47,16 +47,28 @@ public class StepState_2002 : StepState
|
|||
else if (num == 2)
|
||||
{
|
||||
//¹¤×÷Ô¤Ô¼
|
||||
float disSorg = 100000000;
|
||||
SorghumController targetSorg = null;
|
||||
SorghumController[] sorghumControllers = GameObject.FindObjectsOfType<SorghumController>();
|
||||
foreach (var item in sorghumControllers)
|
||||
{
|
||||
if (item.State == SorghumState.Healthy)
|
||||
{
|
||||
item.triggerName = "高粱_正常1";
|
||||
break;
|
||||
float dis = Vector3.Distance(OfficeManager.Instance.firstPersonController.transform.position ,item.transform.position);
|
||||
if (dis < disSorg)
|
||||
{
|
||||
targetSorg = item;
|
||||
disSorg = dis;
|
||||
}
|
||||
//item.triggerName = "¸ßÁ»_Õý³£1";
|
||||
//break;
|
||||
}
|
||||
|
||||
}
|
||||
if (targetSorg != null)
|
||||
{
|
||||
targetSorg.triggerName = "¸ßÁ»_Õý³£1";
|
||||
}
|
||||
//OfficeManager.Instance.mobileController.downIndex = 1;
|
||||
|
||||
}
|
||||
|
|
@ -64,6 +76,7 @@ public class StepState_2002 : StepState
|
|||
{
|
||||
//¹¤×÷Ô¤Ô¼
|
||||
//OfficeManager.Instance.mobileController.downIndex = 1;
|
||||
|
||||
SorghumController[] sorghumControllers = GameObject.FindObjectsOfType<SorghumController>();
|
||||
foreach (var item in sorghumControllers)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@ public class OfficeManager : SingletonMono<OfficeManager>
|
|||
public GameObject currentTool;
|
||||
public Transform spawnToolPos;
|
||||
public Transform tMDTips;
|
||||
|
||||
[HideInInspector]
|
||||
public FirstPersonController firstPersonController;
|
||||
|
||||
/// <summary>
|
||||
/// ÊÖ»ú
|
||||
|
|
@ -20,7 +21,7 @@ public class OfficeManager : SingletonMono<OfficeManager>
|
|||
//private FirstPersonController firstPersonController;
|
||||
private void Start()
|
||||
{
|
||||
//firstPersonController = GameObject.FindGameObjectWithTag("Player").GetComponent<FirstPersonController>();
|
||||
firstPersonController = GameObject.FindGameObjectWithTag("Player").GetComponent<FirstPersonController>();
|
||||
//firstPersonController.gameObject.SetActive(false);
|
||||
//GameManager.EventMgr.AddEventListener(Enum_EventType.OfficeTimeLineOver, OfficeTimeLineOver);
|
||||
//GameManager.EventMgr.AddEventListener<bool>(Enum_EventType.PlayerCanMove, SwitchFirstPersonControllerMove);
|
||||
|
|
|
|||
Loading…
Reference in New Issue