Ejemplo n.º 1
0
	// Sets
	public void setAwake()
    { 
		currentDashResistance = maxDashResistance;

        currentHealth = maxHealth;                          		        // Sets the player health to the value of maxHealth that you indicated.

		sword10Active = false;                                		        // Sets the sword10Active bool to false by default.
        //sword20Active = false;                                		    // Sets the sword20Active bool to false by default.
        chain10Active = false;                                		        // Sets the chain10Active bool to false by default.

        playerSphereCollider = GetComponent<SphereCollider>();
        playerCapsuleCollider = GetComponent<CapsuleCollider>();
        attack10Collider = GetComponentInChildren<BoxCollider>();      	        // Gets the BoxCollider of the PlaceHolder_Sword children.
		attack01ColliderRadius = attack01Collider.radius;   

        playerAudio = GetComponent<AudioSource>();          		        // Gets the component AudioSource from the player.

        timeStunned = timeStunnedIni;

        flashColor = new Color(1.0f, 0.0f, 0.0f, 0.1f);           		    // Sets the color values for the damageImage.
        swordSprite.enabled = true;
        chainSprite.enabled = false;
        sword10Sprite.enabled = false;
        sword20Sprite.enabled = false;
        chain10Sprite.enabled = false;

        swordMaterial = GetComponent<Renderer>().material;
        playerAttack = GetComponent<PlayerAttack>();
        playerAnimation = GetComponent<PlayerAnimation>();
        playerController = GetComponent<PlayerController>();
        chainTransition = GetComponentInChildren<ChainAnimTrigger>();
        anim = GetComponent<Animator>();

        state = PlayerStates.AWAKE;                         		        // Cals the AWAKE state.
	}
Ejemplo n.º 2
0
	// Sets
	public void setAwake()
    { 
		currentDashResistance = maxDashResistance;

        currentHealth = maxHealth;                          		        // Sets the player health to the value of maxHealth that you indicated.

		sword10Active = false;                                		        // Sets the sword10Active bool to false by default.
        //sword20Active = false;                                		        // Sets the sword20Active bool to false by default.
        chain10Active = false;                                		        // Sets the chain10Active bool to false by default.

        sphereCollider = GetComponent<SphereCollider>();
        capsuleCollider = GetComponent<CapsuleCollider>();
        attackAction = GetComponentInChildren<BoxCollider>();      	        // Gets the BoxCollider of the PlaceHolder_Sword children.
		attack01ColliderRadius = attack01Collider.radius;

        chainTransition = GetComponentInChildren<ChainAnimTrigger>();       

        playerAudio = GetComponent<AudioSource>();          		        // Gets the component AudioSource from the player.

        timeStunned = timeStunnedIni;

        flashColor = new Color(1.0f, 0.0f, 0.0f, 0.1f);           		    // Sets the color values for the damageImage.
        swordSprite.enabled = true;
        chainSprite.enabled = false;
        sword10Sprite.enabled = false;
        sword20Sprite.enabled = false;
        chain10Sprite.enabled = false;
        newAbility.color = new Color(0.0f, 0.0f, 0.0f, 0.0f);
        
        pointsText = GameObject.FindGameObjectWithTag("Score");
        score = pointsText.GetComponent<PointCounter>();

        rigidBody = GetComponent<Rigidbody>();              		        // Gets the RigidBody from the GameObject.

        anim = GetComponent<Animator>();

        swordMaterial = GetComponent<Renderer>().material;

        blackScreen.enabled = false;
        counterMenu = counterMenuAux;
        victoryText.enabled = false;
        lostText.enabled = false;

        state = PlayerStates.AWAKE;                         		        // Cals the AWAKE state.
	}