private void OnCaseChanged(object sender, CaseChangedEventArgs e) { if (e.state == Case.DEATH) { ai.OnCaseChanged(new CaseChangedEventArgs(null, Case.RESET)); Death(); } }
public void OnCaseChanged(object sender, CaseChangedEventArgs e) { if (e.state == Case.AVAILABLE) { ai.currentState = Case.AVAILABLE; Decision(); } }
public void OnCaseChanged(object sender, CaseChangedEventArgs e) { if (e.state == Case.WANDER) { ai.currentState = Case.WANDER; Run(); Wander(); } }
private void OnCaseChanged(object sender, CaseChangedEventArgs e) { if (e.state == Case.AVAILABLE) { CaseContainer.Adjust(ai.caseDatas, Case.FLEE, flee ? 1 : 0); } else if (e.state == Case.IDENTITY_UPDATE) { vision = ai.Identity.Vision; } }
private void OnCaseChanged(object sender, CaseChangedEventArgs e) { if (e.state == Case.GROWTH) { print("1"); StartCoroutine(Growth()); } else if (e.state == Case.RESET) { phase = phaseCount; growth = 0; } }
public void OnCaseChanged(object sender, CaseChangedEventArgs e) { if (e.state == Case.IDLE) { defaultTime = idleTime; if (e.data != null) { e.data.SetData(this); } else { tempTime = defaultTime; } ai.currentState = Case.IDLE; ai.Stop(); Run(); } }
private void OnCaseChanged(object sender, CaseChangedEventArgs e) { if (e.state == Case.REPRODUCTION) { if (e.data != null) { e.data.SetData(this); } if (target == null) { target = FindPartner(); } if (target != null) { ai.currentState = Case.REPRODUCTION; Run(); } else { ai.HandleSpeed(SpeedPhase.WALK); ai.OnCaseChanged(new CaseChangedEventArgs(null, Case.WANDER)); } } else if (e.state == Case.AVAILABLE) { CaseContainer.Adjust(ai.caseDatas, Case.REPRODUCTION, reproductionUrge); } else if (e.state == Case.IDENTITY_UPDATE) { UpdateData(); } else if (e.state == Case.RESET) { reproductionUrge = 0; alerted = false; isRunning = false; canReproduce = false; } }
public void OnCaseChanged(object sender, CaseChangedEventArgs e) { print(e.state); if (e.state == Case.HUNGER) { if (e.data != null) { SetReportedData(e.data); return; } target = FindFood(); if (target != null) { ai.currentState = Case.HUNGER; Run(); } else { ai.HandleSpeed(SpeedPhase.WALK); ai.OnCaseChanged(new CaseChangedEventArgs(null, Case.WANDER)); } } else if (e.state == Case.IDENTITY_UPDATE) { vision = ai.Identity.Vision; print("1"); } else if (e.state == Case.AVAILABLE) { CaseContainer.Adjust(ai.caseDatas, Case.HUNGER, hunger); } else if (e.state == Case.RESET) { isRunning = false; hunger = 0; alerted = false; } }
public void OnCaseChanged(object sender, CaseChangedEventArgs e) { if (e.state == Case.THIRST) { if (e.data != null) { SetReportedData(e.data); return; } target = FindWater(); if (target != null) { ai.currentState = Case.THIRST; Run(); _animationManager.SetState(AnimationType.Walk); ai.Move(target.position); } else { ai.HandleSpeed(SpeedPhase.WALK); ai.OnCaseChanged(new CaseChangedEventArgs(null, Case.WANDER)); } } else if (e.state == Case.IDENTITY_UPDATE) { vision = ai.Identity.Vision; } else if (e.state == Case.AVAILABLE) { CaseContainer.Adjust(ai.caseDatas, Case.THIRST, thirst); } else if (e.state == Case.RESET) { thirst = 0; alerted = false; isRunning = false; target = null; } }