Assignment for RMIT Mixed Reality in 2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

25 lines
449 B

namespace Oculus.Platform.Samples.VrHoops
{
using UnityEngine;
using System.Collections;
// An AI Player just shoots a ball forward with some random delay.
public class AIPlayer : Player {
void FixedUpdate ()
{
if (HasBall)
{
// add a little randomness to the shoot rate so the AI's don't look synchronized
if (Random.Range(0f, 1f) < 0.03f)
{
ShootBall();
}
}
else
{
CheckSpawnBall();
}
}
}
}