Game Development Reference
In-Depth Information
public var shotRange : float = 15.0;
//Detected the player - increase from the shot range
public var getPlayerRange : float = 5.0;
//Max distance from waypoint
public var waypointDistance : float = 10.0;
//To make the enemy walk for 4 seconds - then think
public var walkingTime : float = 4.0;
//To make the enemy stop for 2 seconds - then walk
public var thinkingTime : float = 2.0;
//Ai current HP
public var aiHP : float = 100;
//AI MAx HP
private var aiMaxHP : float;
//Character Controller
private var controller : CharacterController;
//Collision Flag return from Moving the character
private var c_collisionFlags : CollisionFlags;
//Move Params
private var f_verticalSpeed : float = 0.0;
private var f_moveSpeed : float = 0.0;
private var v3_moveDirection : Vector3 = Vector3.zero;
//Boolean
private var b_isRun : boolean;
private var b_isAiming : boolean;
private var b_isJumping : boolean;
private var b_isStop : boolean;
//Shot Params
private var b_isPrepare : boolean = false;
private var b_isShot : boolean = false;
//Rotate Params
private var q_currentRotation : Quaternion; //current rotation of
the character
private var q_rot : Quaternion; //Rotate to left or right
direction
private var f_rotateSpeed : float = 1.0; //Smooth speed of
rotation
//Stop time Counting
private var f_lastTime : float = 0;
With the preceding code, we basically created all the necessary parameters for our
AIController script.
 
Search WWH ::




Custom Search