Add most of research
This commit is contained in:
41
GOAP/Assets/Scrips/Human.cs
Normal file
41
GOAP/Assets/Scrips/Human.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Scrips
|
||||
{
|
||||
public class Patient : AI_Agent
|
||||
{
|
||||
[SerializeField] TextMeshProUGUI _currentStatePrint;
|
||||
[SerializeField] private Material m_Healthy;
|
||||
[SerializeField] private Material m_Sick;
|
||||
|
||||
|
||||
protected override void Start()
|
||||
{
|
||||
base.Start();
|
||||
var s1 = new SubGoal("IsWaiting", 1, true);
|
||||
goals.Add(s1, 1);
|
||||
|
||||
var s2 = new SubGoal("IsTreated", 1, true);
|
||||
goals.Add(s2, 3);
|
||||
|
||||
var s3 = new SubGoal("IsHome", 1, true);
|
||||
goals.Add(s3, 5);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (_currentStatePrint != null && planner != null)
|
||||
{
|
||||
// _currentStatePrint.text = "Nurse 1 Action: " + currentAction.actionName + "\n" + planner.GetPlanString();
|
||||
_currentStatePrint.text = "Patient 1 Action: " + currentAction.actionName + "\n";
|
||||
}
|
||||
|
||||
if( agentWorldStates.GetStates().ContainsKey("IsHealthy") &&
|
||||
agentWorldStates.GetStates()["IsHealthy"] > 0)
|
||||
{
|
||||
GetComponent<Renderer>().material = m_Healthy;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user