Esempio n. 1
0
    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;
        }
    }
Esempio n. 2
0
 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>();
 }
Esempio n. 3
0
    void Awake()
    {
        networkView   = GetComponent <NetworkView>();
        cameraRef     = Camera.main;
        localInputRef = this;
        playerRef     = gameObject.GetComponent <Player>();

        if (!Network.isClient)
        {
            movementRef = gameObject.GetComponent <BasicMovementServer>();
        }
    }