Ejemplo n.º 1
0
 /**<summary> Set random navmesh point in current area as target </summary>*/
 virtual public void RandomTarget()
 {
     if (agent.isOnNavMesh)
     {
         target            = RaycastSpawner.GetRandomPoint(WorldController.CurrentAreaBounds());
         agent.destination = target;
     }
 }
Ejemplo n.º 2
0
    /**<summary> Add Collectable to the world </summary>*/
    public void AddCollectable()
    {
        ItemData item = Instantiate(energyTemplates[UnityEngine.Random.Range(0, energyTemplates.Length)]);

        item.position = RaycastSpawner.GetRandomPoint(currentArea.bounds.GetUnityBounds(), player.position, 3, energyMaxDistance);
#pragma warning disable 4014
        AddItem(item, false);
#pragma warning restore 4014
        lastCollectableTime = Time.time + UnityEngine.Random.Range(-energySpawnRate * 0.1f, energySpawnRate * 0.1f);
        energyAmount++;
    }