Exemple #1
0
    private void Awake()
    {
        //Get the PandemicArea
        pandemicArea    = GetComponentInParent <PandemicArea>();
        pandemicAreaObj = pandemicArea.gameObject;

        targetPosition = pandemicArea.ChooseRandomPosition();
        GetComponent <SphereCollider>().radius = exposureRadius;
        recoverTime = pandemicArea.recoverTime;
    }
Exemple #2
0
    /// <summary>
    /// Initialize the agent
    /// </summary>
    public override void Initialize()
    {
        rb = GetComponent <Rigidbody>();

        //Get the PandemicArea and its settings
        pandemicArea    = GetComponentInParent <PandemicArea>();
        pandemicAreaObj = pandemicArea.gameObject;
        statRecorder    = pandemicAreaObj.GetComponentInChildren <statRecorder>();

        //define parameters as environment parameters for randomization and curriculum learning
        m_ResetParams = Academy.Instance.EnvironmentParameters;
        SetResetParameters();
    }
Exemple #3
0
    private void Awake()
    {
        //Get the PandemicArea
        pandemicArea    = GetComponentInParent <PandemicArea>();
        pandemicAreaObj = pandemicArea.gameObject;

        GetComponent <SphereCollider>().radius = exposureRadius;
        recoverTime = pandemicArea.recoverTime;

        rb = GetComponent <Rigidbody>();
        initialVelocity = new Vector3(UnityEngine.Random.Range(5, 20), 0, UnityEngine.Random.Range(5, 20));
        //Debug.Log("initial Vel:" + initialVelocity);
        rb.velocity = initialVelocity.normalized * constantSpeed;
    }
Exemple #4
0
    private void Awake()
    {
        //Get the PandemicArea
        pandemicArea    = GetComponentInParent <PandemicArea>();
        pandemicAreaObj = pandemicArea.gameObject;

        targetPosition = pandemicArea.ChooseRandomPosition();
        GetComponent <SphereCollider>().radius = exposureRadius;
        recoverTime = pandemicArea.recoverTime;

        rb = GetComponent <Rigidbody>();
        initialVelocity = new Vector3(UnityEngine.Random.Range(-20, 20), 0, UnityEngine.Random.Range(-20, 20));

        coroutine = WaitAtStart(2f);
        //StartCoroutine(coroutine);
    }
Exemple #5
0
 // Start is called before the first frame update
 void Start()
 {
     pandemicArea = GetComponentInParent <PandemicArea>();
     text         = GetComponent <Text>();
 }
 void Start()
 {
     pandemicArea = GetComponentInParent <PandemicArea>();
     m_Recorder   = Academy.Instance.StatsRecorder;
 }