示例#1
0
    public void Death()
    {
        Transform death_Sword = Instantiate(death_swordPrefab, new Vector3(transform.position.x, transform.position.y, -0.03f), transform.rotation) as Transform;

        //THIS LINE GETS IF THE PLAYER WAS IN COMBO AND AT WICH MULTIPLICATOR HE WAS (USED FOR TEMPLE REGEN TIMER)
        if (SC_playerComboCounterRef.b_isActive == true && SC_playerComboCounterRef.i_killCount > 0)
        {
            i_storedKillCount = SC_playerComboCounterRef.i_killCount;
        }

        //ESSAI SPAWN ENNEMI
//		if(i_storedKillCount/4 > 0)
//		{
//			for(int i = 0;i<(i_storedKillCount/4); i++)
//			{
//				GameObject ennemiTemp = Instantiate(SC_SpawnerManagerRef.ChooseEnemy(), new Vector3(transform.position.x+i,  transform.position.y+i, -0.04f), Quaternion.identity) as GameObject;
//			}
//		}


//		SC_PlayerRef.rumble(0.4f);

        //SC_BatimentChoiceRef.instantDestroy();
        b_isActive = false;
        b_Alive    = false;
        SC_PlayerRef.resetKillCount();
        SC_PlayerRef.AnimationHandeler("Death");                        //Animation de mort
//		l_LifeLamp.enabled = false;

        transform.tag      = null;
        transform.position = v_respawnPoint;
        SC_PlayerRef.stopRumble();
        SC_PlayerRef.StopMvt();
        SC_PlayerRef.DashEnd();
        SC_PlayerRef.enabled = false;
        renderer.enabled     = false;
//		_charactRenderer.SetActive(false);

        //Audio Mort
        SC_PlayerRef._StateAudioSource.Stop();
        SC_PlayerRef._StateAudioSource.PlayOneShot(SC_PlayerRef._Sounds.GetSound("Death"));

        SC_templeReincarnateRef.addDeadPlayer(this.gameObject);
    }