void Attack() { if (AIBaseController.humanInSight) { if ((targetPosition - (Vector2)Human.humanRef.transform.position).magnitude > 0.75f) { //Debug.Log("Recalculando posicion"); targetPosition = BasicMovementServer.redondearPosicion(Human.humanRef.transform.position); if (!base.CalculatePathTo(targetPosition)) { targetPosition = new Vector2(999, 999); } statusWhenLastPosition = robotAIStatus; } } else { robotAIStatus = RobotAIStatus.Search; //base.CalculatePathTo(AIBaseController.humanKnownPosition); wlkToRandomPositionAround(AIBaseController.humanKnownPosition, 8); statusWhenLastPosition = robotAIStatus; } }
public virtual void Initialize() { //Debug.Log("inicializado Player"); transform.position = spawnPoint; gameObject.GetComponent <HoveringName>().playerRef = this; networkView = GetComponent <NetworkView>(); colliderJugador = GetComponent <CircleCollider2D>(); basicMovementServer = GetComponent <BasicMovementServer>(); }
void Awake() { networkView = GetComponent <NetworkView>(); cameraRef = Camera.main; localInputRef = this; playerRef = gameObject.GetComponent <Player>(); if (!Network.isClient) { movementRef = gameObject.GetComponent <BasicMovementServer>(); } }