void Awake()
        {
            controlCoinGame = GetComponent <ControlCoinInGame>();

            if (PlayerData.playerData == null)
            {
                print("Null");
            }
            progCombat = PlayerData.playerData.progressionCombat;

            typeDiceMap = mediatorBoard.GetMapTypeRandom();
            mediatorBoard.SetTypeLootMap(typeDiceMap);

            mediatorBoard.CreatePrincipalWay(progCombat.largeOfTheListRow, progCombat.largeOfTheListColumn);
        }
Example #2
0
        public void NewCombatTypeCharacter(Vector2 lastPosition, GameObject prefabEnemy, CharacterBoard characterBoardEnemy)
        {
            //instanciar combate en la zona que llega por referencia
            gameObjectCombatZone = Instantiate(instantiateCombatZone, new Vector3(lastPosition.x, 0, lastPosition.y), MediatorBoard.Mediator.GetRotationPlayer());

            //cambiar la camara, animacion para mostrar la zona de combate
            GameObject goCamera = GameObject.Find("CameraCombatZone");

            transformCameraCombat.transform.position = goCamera.transform.position;
            transformCameraCombat.transform.rotation = goCamera.transform.rotation;
            transformCameraCombat.SetActive(true);
            transformCameraMain.gameObject.SetActive(false);
            playableDirector.Play();

            //para usar con el player
            goCamera.transform.localPosition = goCamera.transform.localPosition + new Vector3(correctionXEnemy, -0.7f, 0.91f);

            //instanciar el enemigo en la zona
            characterBoard           = characterBoardEnemy;
            enemy                    = prefabEnemy;//Instantiate(characterBoard.prefabGameObject, goCamera.transform.position, MediatorBoard.Mediator.GetRotationPlayer());
            enemy.transform.position = goCamera.transform.position;
            enemy.transform.rotation = MediatorBoard.Mediator.GetRotationPlayer();

            //progcombat
            progressionCombat = MediatorBoard.Mediator.GetProgressionCombat();

            //mover mi jugador a la zona,
            //MediatorBoard.Mediator.ChangePositionPlayerToCombat(new Vector3(lastPosition.x - correctionXEnemy, 0.65f, lastPosition.y));

            //actualizar  UI, tiempo, vida de enemigo
            animatorEnemy = enemy.GetComponent <Animator>();
            StartDataEnemy((int)progressionCombat.GetStat(Stat.Health, characterBoard.GetCharacterClass(), levelEnemy),
                           progressionCombat.GetStat(Stat.AttackSpeed, characterBoard.GetCharacterClass(), levelEnemy));

            ///update life player
            //actualizar habilidades que puede tirar mi jugador, ui combat player
            StartDataCombatPlayer();

            //empieza a correr el tiempo, empiezan a recargarse las habilidades
            isCombat = true;

            //empezar loop de combate
            GOUICombatSystem.SetActive(true);

            //update:
            ////enemigo tiene que mirar si puede atacar en el update (este), entonces empieza a atacar
        }