Beispiel #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.
        trailActivation = false;

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

        chainTransition = GetComponentInChildren <ChainAnimTrigger>();

        crackGround.SetActive(false);

        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;
        cooldownSword10.enabled = false;

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

        slashFX.Stop();
    }
Beispiel #2
0
    // Sets
    public void setAwake()
    {
        // Health
        currentHealth = maxHealth;                                              // Sets the player health to the value of maxHealth that you indicated.

        // Speed
        baseSpeed = characterBehaviour.speed;

        // Attacks&Abilitites
        sword10Active = false;                                                  // Sets the sword10Active bool to false by default.

        // Stunned
        timeStunned = timeStunnedIni;

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

        // UI
        sword10Sprite.SetActive(false);
        newAbility.enabled      = false;
        flashColor              = new Color(1.0f, 0.0f, 0.0f, 0.1f);        // Sets the color values for the damageImage.
        blackScreen.enabled     = false;
        victoryText.enabled     = false;
        lostText.enabled        = false;
        cooldownSword10.enabled = false;

        // Control player
        swordMaterial          = GetComponent <Renderer>().material;
        attack01ColliderRadius = attack01Collider.radius;
        playerAttack           = GetComponent <PlayerAttack>();
        playerAnimation        = GetComponent <PlayerAnimation>();
        characterBehaviour     = GetComponent <CharacterBehaviour>();
        characterController    = GetComponent <CharacterController>();

        // Animator
        anim            = GetComponent <Animator>();
        chainTransition = GetComponentInChildren <ChainAnimTrigger>();

        state = PlayerStates.AWAKE;                                             // Cals the AWAKE state.
    }
Beispiel #3
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.
	}
	// 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.
	}