Ejemplo n.º 1
0
    public void SetupPlayer(BGameManager manager, DPlayerInfo playerInfo, List <int> endIndex)
    {
        // Cargamos los datos basicos del jugador
        rotateLeft   = playerInfo.rotateLeft;
        rotateRight  = playerInfo.rotateRight;
        move         = playerInfo.move;
        rotationTime = playerInfo.rotationTime;
        moveTime     = playerInfo.moveTime;
        recogerCable = playerInfo.recogerCable;

        // Cargamos el manager del nivel
        gameManager = manager;

        // Obtenemos el tablero
        board = gameManager.GetActiveBoard();

        // Actualizamos los Ap que tenemos para el nivel
        Ap = maxAP = board.GetBoardAp();

        // Colocamos al jugador en la casilla de salida y guardamos su indice
        tileIndex = board.PositionToIndex(transform.position);

        // Guardamos los indices finales
        this.endIndex = endIndex;

        // Inicializa el camino
        RestartPath();

        // Temporal
        textAp      = GameObject.Find("TextApPrueba").GetComponent <Text>();
        textAp.text = "AP: " + Ap;
    }
Ejemplo n.º 2
0
    public void SetupMuro(BGameManager manager)
    {
        active      = true;
        boardScript = manager.GetActiveBoard();

        gameManager = manager;
    }
Ejemplo n.º 3
0
    public void SetupDoor(BGameManager manager)
    {
        active = true;

        gameManager = manager;
        boardScript = manager.GetActiveBoard();

        setEdges(abierta);
    }
Ejemplo n.º 4
0
    public void SetupBaliza(BGameManager manager)
    {
        boardScript = manager.GetActiveBoard();
        gameManager = manager;

        pantalla1 = this.transform.Find("Pantalla").gameObject;

        testPantalla = this.transform.Find("CanvasPrueba2/Pantalla").gameObject;
        testPantalla.SetActive(false);
    }
Ejemplo n.º 5
0
    //public BNode(BComposite parent, string name = "default")
    //{
    //    NodeName = name;
    //    SetParent(parent);
    //    m_Decorators = new List<BDecorator>();
    //}

    public virtual void SetParent(BComposite parent)
    {
        m_BB = parent.m_BB;
        m_BT = parent.m_BT;
        foreach (var dec in m_Decorators)
        {
            dec.m_BT = parent.m_BT;
            dec.m_BB = m_BB;
        }
        m_ParentSuccess = parent.ChildSuccess;
        m_ParentFailure = parent.ChildFailure;
    }
Ejemplo n.º 6
0
    private void Awake()
    {
        m_BossController = GetComponentInParent <Boss3_Controller>();
        m_NavAgent       = GetComponent <NavMeshAgent>();
        m_Rb             = GetComponent <Rigidbody>();
        m_Anim           = GetComponentInChildren <Animator>();
        m_DamageComp     = GetComponent <Damageable>();
        m_DamageComp.Del_ReciveDamage = Damaged;

        m_BT = GetComponent <BehaviorTree>();
        m_BB = GetComponent <BBoard>();
    }
Ejemplo n.º 7
0
    // Update is called once per frame
    void Update()
    {
        if (utilizable && (boardScript != null) && (boardScript == gameManager.GetActiveBoard()))
        {
            // Actualiza la posición de la pantalla en el canvas
            BBoard  board  = gameManager.GetActiveBoard();
            Camera  cam    = board.GetCamera().GetComponent <Camera>();
            Vector3 newPos = cam.WorldToScreenPoint(pantalla1.transform.position);
            testPantalla.transform.position = newPos;

            // Actualiza la escala de la pantalla para simular la perspectiva
            float dist = Vector3.Distance(cam.transform.position, this.transform.position);
            testPantalla.transform.localScale = Vector3.one / dist * 10f;
        }
    }
Ejemplo n.º 8
0
    // Start is called before the first frame update
    void Start()
    {
        // Obtenemos el primer board
        activeBoard = debugArray[iter].GetComponent <BBoard>();

        // Hacemos el Setup del Board y de todos sus componentes
        activeBoard.SetupBoard(this, false);

        // Actualizamos nuestras variables
        UpdateActive(false);

        // Llamamos a la corutina encargada de mostrar todos los objetos
        StartCoroutine(LoadObjects(false));

        boardCompleted = false;
    }
Ejemplo n.º 9
0
    public IEnumerator SwapActiveBoard(BBoard newBoard, bool playableLevel)
    {
        yield return(StartCoroutine(DisolveObjects()));

        // Terminamos el ultimo Board Activo
        activeBoard.EndBoard();

        activeBoard = newBoard;

        activeBoard.SetupBoard(this, playableLevel);

        UpdateActive(playableLevel);

        StartCoroutine(LoadObjects(playableLevel));

        yield return(null);
    }
Ejemplo n.º 10
0
    // Update is called once per frame
    void Update()
    {
        active = (boardScript != null) && (boardScript == gameManager.GetActiveBoard());

        if (active)
        {
            if (numInteracciones == Nivel && hackeable)
            {
                hackeable = false;
                AccionTrasHackear();
                transform.Find("CanvasPrueba2/Pantalla/Boton").GetComponent <Button>().interactable = hackeable;
                //System.Array.Reverse(this.GetComponent<MeshRenderer>().materials);
            }

            // Actualiza la posición de la pantalla en el canvas
            BBoard  board  = gameManager.GetActiveBoard();
            Camera  cam    = board.GetCamera().GetComponent <Camera>();
            Vector3 newPos = cam.WorldToScreenPoint(pantalla1.transform.position);
            testPantalla.transform.position = newPos;

            // Actualiza la escala de la pantalla para simular la perspectiva
            float dist = Vector3.Distance(cam.transform.position, this.transform.position);
            testPantalla.transform.localScale = Vector3.one / dist * 10f;
        }
        else
        {
            pantalla1.SetActive(false);
            testPantalla.SetActive(false);

            hackeable = false;
        }

        if (!activada)
        {
            //TODO shader o color ¿gris?
        }
        else if (numInteracciones == Nivel)
        {
            //TODO shader o color rojo
        }
        else
        {
            //TODO shader o color verde
        }
    }
Ejemplo n.º 11
0
    public void SetupTerminal(BGameManager manager)
    {
        active      = true;
        boardScript = manager.GetActiveBoard();

        gameManager = manager;

        pantalla1 = this.transform.Find("Pantalla").gameObject;

        mensaje1 = ("NIVEL TERMINAL " + Nivel);
        mensaje2 = ("Proceso " + numInteracciones / Nivel * 100 + "%");

        hackeable = false;

        testPantalla = this.transform.Find("CanvasPrueba2/Pantalla").gameObject;
        testPantalla.SetActive(false);

        objetoHackeado = this.GetComponent <BTerminal>().objetoHackeado;
        hackAction     = EAccionHack.Door;
    }
Ejemplo n.º 12
0
    public void SetupEnemy(BGameManager gameManager)
    {
        // Guardamos el gameManager
        this.gameManager = gameManager;

        // Obtenemos el tablero
        board = gameManager.GetActiveBoard();

        // Obtenemos el vector hacia arriba del tablero
        boardUP = board.GetBoardUp();

        // Posicion inicial del jugador en el waypoint 0
        transform.position = board.GetEnemySpawnPos(wayPoints[0].position, GetEnemyBounds().size);

        // Obtenemos el camino que tendra que recorrer el enemigo
        CreatePath();

        // Rotacion inicial mirando hacia el waypoint 1
        transform.rotation = Quaternion.LookRotation(path[1] - path[0], boardUP);

        // Activamos la colision
        GetComponent <CapsuleCollider>().enabled = true;

        // Obtenemos el indice del tablero en el que estamos
        boardIndex = board.PositionToIndex(transform.position);

        // Obtenemos el indice del array de waypoints en el que estamos
        pathIndex = 0;

        // Iniciamos la variable del pathDirection
        pathDirection = 1;

        // Definimos que el enemigo no se esta moviendo
        isMoving = false;

        // Definimos que la partida no se ha acabado todavia
        gameOver = false;
    }
Ejemplo n.º 13
0
    public void SetupCamera(BGameManager manager, DCameraInfo cameraInfo)
    {
        // Inicializamos los valores en funcion de los datos
        rotateLeft         = cameraInfo.rotateLeft;
        rotateRight        = cameraInfo.rotateRight;
        moveUp             = cameraInfo.moveUp;
        moveDown           = cameraInfo.moveDown;
        moveLeft           = cameraInfo.moveLeft;
        moveRight          = cameraInfo.moveRight;
        cameraMoveSpeed    = cameraInfo.cameraSpeed;
        cameraRotationTime = cameraInfo.rotationTime;
        cameraOrtoMax      = cameraInfo.farZoomClamp;

        // Guardamos el target
        parentT = transform.parent;

        // Hacemos que la camara se centre en el target
        transform.LookAt(parentT);

        // Obtenemos el tablero
        BBoard board = manager.GetActiveBoard();

        // Obtenemos los limites del tablero
        Vector4 aux = board.GetBoardLimits();

        min1 = aux.x;
        max1 = aux.y;
        min2 = aux.z;
        max2 = aux.w;

        // Colocamos la camara con la posicion inicial
        parentT.position = board.GetPlayerSpawnPos(0f);
        parentT.rotation = board.GetPlayerSpawnRot();

        // Obtenemos el sistema de coordenadas
        coordSys = board.GetCoordSys();
    }
Ejemplo n.º 14
0
    //ビヘイビアの設定
    private void SetUpBT()
    {
        m_BB = GetComponent <BBoard>();
        m_BT = GetComponent <BehaviorTree>();
        m_BT.Init();
        m_BT.SetBoard(m_BB);

        BParallel par_Look_Other = new BParallel();
        //LookAtPlayer
        BT_LookTarget lookTarget      = new BT_LookTarget("target", 5.0f);
        BSelector     sl_Rocket_Other = new BSelector();

        m_BT.SetRootNode(par_Look_Other);

        /*ロケットパンチ*/
        BT_FireRocket BTT_Rocket      = new BT_FireRocket(m_Battery);
        BDecorator    dec_RocektRnage = new BD_CloserThen("target", m_RocketRange);

        BTT_Rocket.AddDecorator(dec_RocektRnage);
        BTT_Rocket.AddDecorator(new BD_CoolTime(m_RocketInterval));

        //接近
        BSequence seq         = new BSequence();
        BT_MoveTo moveToRange = new BT_MoveTo("target", m_Speed);

        moveToRange.m_StopDistance    = m_RocketRange;
        moveToRange.m_IsCanCancelMove = false;
        //moveToRange.AddDecorator(new BD_CloserThen("target", m_NeedMoveDistance).Invert());

        seq.AddNode(moveToRange);

        sl_Rocket_Other.AddNode(BTT_Rocket);
        sl_Rocket_Other.AddNode(seq);
        par_Look_Other.AddNode(lookTarget);
        par_Look_Other.AddNode(sl_Rocket_Other);
    }
Ejemplo n.º 15
0
 // PUT: api/Board/5
 public BBoard PutBoard(int id, BBoard value)
 {
     return(boardService.CreateOrUpdate(value));
 }
Ejemplo n.º 16
0
 // POST: api/Board
 public BBoard PostBoard(BBoard value)
 {
     return(boardService.CreateOrUpdate(value));
 }
Ejemplo n.º 17
0
 public void SetBoard(BBoard board)
 {
     m_BB = board;
 }