// ------------------- FUNCOES UNITY ------------------- //

    private void Start()
    {
        // Inicializa
        rigidBody2D           = this.GetComponent <Rigidbody2D>();
        animator              = this.GetComponent <Animator>();
        spriteRenderer        = this.GetComponent <SpriteRenderer>();
        playerRevisao         = FindObjectOfType(typeof(PlayerRevisao)) as PlayerRevisao;
        gameControllerRevisao = FindObjectOfType(typeof(GameControllerRevisao)) as GameControllerRevisao;

        // Desabilita objetos
        ballonAlert.SetActive(false);

        // Muda posicao
        if (isLookingLeft)
        {
            Flip();
        }

        // Chama funcoes
        Material material = (isOnDark ? gameControllerRevisao.light2D : gameControllerRevisao.default2D);

        ChangeMaterial(material);
        ChangeState(initialState);
        ChangeWeapon(weaponID);
    }
예제 #2
0
    // ------------------- FUNCOES UNITY ------------------- //

    private void Start()
    {
        // Pegando components
        animator               = this.GetComponent <Animator> ();
        rigidBody2D            = this.GetComponent <Rigidbody2D> ();
        spriteRenderer         = this.GetComponent <SpriteRenderer> ();
        gameControllerRevisao  = FindObjectOfType <GameControllerRevisao>();
        audioControllerRevisao = FindObjectOfType <AudioControllerRevisao>();

        // Inicializa parametros
        maxLife    = gameControllerRevisao.playerMaxLife;
        weaponID   = gameControllerRevisao.weaponID;
        actualLife = maxLife;
        gameControllerRevisao.playerActualMana = gameControllerRevisao.playerMaxMana;

        // Desabilita armas, arcos, e staffs

        foreach (GameObject weapon in weapons)
        {
            weapon.SetActive(false);
        }

        foreach (GameObject bow in bows)
        {
            bow.SetActive(false);
        }

        foreach (GameObject staff in staffs)
        {
            staff.SetActive(false);
        }

        ChangeWeapon(weaponID);
    }
예제 #3
0
    // ------------------- FUNCOES UNITY ------------------- //

    private void Start()
    {
        // Recupera instancias - Components
        spriteRenderer = this.GetComponent <SpriteRenderer> ();
        animator       = this.GetComponent <Animator>();

        // Recupera instancias - Objetos
        gameControllerRevisao  = FindObjectOfType(typeof(GameControllerRevisao)) as GameControllerRevisao;
        playerRevisao          = FindObjectOfType <PlayerRevisao>();
        audioControllerRevisao = FindObjectOfType(typeof(AudioControllerRevisao)) as AudioControllerRevisao;

        // Define configuracoes
        actualLife = maxLife;
        lifebarHolder.SetActive(true);
        lifebarHolder.transform.localScale = new Vector3(1, 1, 1);

        // Passa valores
        DamageTypeValues[0] = 1;
        DamageTypeValues[1] = 5;
        DamageTypeValues[2] = 0;

        // Define escala x do Sprite
        if (isLookingLeft)
        {
            Flip(false);
        }
    }
예제 #4
0
    // ------------------- FUNCOES UNITY ------------------- //

    private void Start()
    {
        gameControllerRevisao = FindObjectOfType(typeof(GameControllerRevisao)) as GameControllerRevisao;
        LoadSprites();
        LoadXML();
        LoadWeaponSprites();
        RefreshGameController();
    }
예제 #5
0
    private void Start()
    {
        // Inicializa
        gameControllerRevisao = FindObjectOfType(typeof(GameControllerRevisao)) as GameControllerRevisao;

        // Desabilita paineis
        npcCanvas.SetActive(false);
        answerPanel.SetActive(false);

        LoadXML();
    }
    // ------------------- FUNCOES UNITY ------------------- //

    private void Start()
    {
        // Inicializa
        gameControllerRevisao  = FindObjectOfType <GameControllerRevisao>();
        painelItemInfoRevisao  = FindObjectOfType <PainelItemInfoRevisao>();
        audioControllerRevisao = FindObjectOfType <AudioControllerRevisao>();

        // Proprio botao do slot
        Button btn = this.GetComponent <Button>();

        btn.onClick.AddListener(UseItem);
    }
예제 #7
0
    // ------------------- FUNCOES UNITY ------------------- //

    private void Start()
    {
        // Inicializa
        spriteRenderer        = this.GetComponent <SpriteRenderer>();
        gameControllerRevisao = FindObjectOfType(typeof(GameControllerRevisao)) as GameControllerRevisao;

        // Atualiza spritesheet do player
        if (isPlayer)
        {
            spriteSheetName = gameControllerRevisao.spriteSheetTexture[gameControllerRevisao.playerID].name;
        }

        LoadSpriteSheet();
    }
예제 #8
0
    // ------------------- FUNCOES UNITY ------------------- //

    // Inicializa
    private void Start()
    {
        gameControllerRevisao = FindObjectOfType(typeof(GameControllerRevisao)) as GameControllerRevisao;
        playerRevisao         = FindObjectOfType(typeof(PlayerRevisao)) as PlayerRevisao;

        // Desativa paineis
        manaPanel.SetActive(false);
        arrowPanel.SetActive(false);
        HPBox.SetActive(false);
        MPBox.SetActive(false);

        VerifyPlayerHUD();

        // Posiciona caixas
        boxAPosition = boxARectTransform.anchoredPosition;
        boxBPosition = boxBRectTransform.anchoredPosition;
    }
예제 #9
0
    // ------------------- FUNCOES UNITY ------------------- //

    // Inicializa
    private void Start()
    {
        gameControllerRevisao = FindObjectOfType(typeof(GameControllerRevisao)) as GameControllerRevisao;
    }
 // Inicializa
 private void Start()
 {
     gameControllerRevisao = FindObjectOfType <GameControllerRevisao>();
 }
    // ------------------- FUNCOES UNITY ------------------- //

    // Inicializa
    private void Start()
    {
        efeitoFadeRevisao     = FindObjectOfType <EfeitoFadeRevisao>();
        gameControllerRevisao = FindObjectOfType <GameControllerRevisao>();
    }
예제 #12
0
    // ------------------- FUNCOES UNITY ------------------- //

    private void Start()
    {
        // Inicializa
        spriteRenderer        = this.GetComponent <SpriteRenderer>();
        gameControllerRevisao = FindObjectOfType(typeof(GameControllerRevisao)) as GameControllerRevisao;
    }