// Use this for initialization void Awake() { walk = GetComponent <WalkAbs>(); patrol = GetComponent <Patrol>(); idle = GetComponent <Idle>(); operable = true; this.enabled = false; }
// Use this for initialization void Awake() { walk = GetComponent <WalkAbs>(); patrol = GetComponent <Patrol>(); idle = GetComponent <Idle>(); body = GetComponent <ChipmunkBody>(); stop = true; operable = true; }
public bool isTargetFacingMe() { // if player is facing to the ghost then Dot product will be < 0. Only considers X coordinate Vector2 towardTarget = chase.getTarget().position - transform.position; if (targetWalkComp == null) { targetWalkComp = chase.getTarget().GetComponent <WalkAbs>(); } return((targetWalkComp.getLookingDir().x *towardTarget.x) <= 0f); }
void Awake() { crouching = false; // take the collider and some useful values box = GetComponent <ChipmunkBoxShape>(); colliderCenterY = box.center.y; centerOffsetY = ((1f - crouchColliderProportion) * 0.5f) * box.size.y; jump = GetComponent <Jump>(); sneak = GetComponent <Sneak>(); move = GetComponent <WalkAbs>(); crouchAC = AnimateTiledConfig.getByName(gameObject, EnumAnimateTiledName.Crouch, true); }
private void stop() { targetWalkComp = null; chase.stopChasing(); fly.stopFlying(); }
private float dir = 1f; // default value // Use this for initialization void Awake() { walk = GetComponent <WalkAbs>(); }
// Use this for initialization void Awake() { dir = 1f; // initial normalized direction walk = GetComponent <WalkAbs>(); stop = false; // patrolling is enabled }
void Awake() { move = GetComponent <WalkAbs>(); jump = GetComponent <Jump>(); crouch = GetComponent <Crouch>(); }