Compare commits

..

No commits in common. "ad306fc88544d9ff83c5fb4fd6831aa24ab5b9a4" and "51dfd5085b0b4437b84d3b6074add7aa3684875c" have entirely different histories.

2 changed files with 10 additions and 14 deletions

View File

@ -46,6 +46,7 @@ public class StepState_2002 : StepState
}
else if (num == 2)
{
//工作预约
float disSorg = 100000000;
SorghumController targetSorg = null;
SorghumController[] sorghumControllers = GameObject.FindObjectsOfType<SorghumController>();
@ -59,6 +60,8 @@ public class StepState_2002 : StepState
targetSorg = item;
disSorg = dis;
}
//item.triggerName = "高粱_正常1";
//break;
}
}
@ -66,30 +69,23 @@ public class StepState_2002 : StepState
{
targetSorg.triggerName = "¸ßÁ»_Õý³£1";
}
//OfficeManager.Instance.mobileController.downIndex = 1;
}
else if (num == 3)
{
float disSorg = 100000000;
SorghumController targetSorg = null;
//工作预约
//OfficeManager.Instance.mobileController.downIndex = 1;
SorghumController[] sorghumControllers = GameObject.FindObjectsOfType<SorghumController>();
foreach (var item in sorghumControllers)
{
if (item.State == SorghumState.Diseased)
{
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";
}
}
}
}

View File

@ -87,7 +87,7 @@ public class SorghumFieldController : MonoBehaviour
int iter = (int)(sorghumControllers.Length * UnityEngine.Random.value);
if (iter >= sorghumControllers.Length) iter = sorghumControllers.Length - 1;
if (iter < 0) iter = 0;
sorghumControllers[iter].Init(SorghumState.Diseased, SorghumPeriod.Mature, randomRotate);
sorghumControllers[iter].Init(SorghumState.Healthy, SorghumPeriod.Mature, randomRotate);
sorghumControllers[iter] = sorghumControllers[sorghumControllers.Length - 1];
SorghumController[] newArry = new SorghumController[sorghumControllers.Length - 1];
Array.Copy(sorghumControllers, newArry, sorghumControllers.Length - 1);