Exemplo n.º 1
0
    public void faireDegat(float quantiter)
    {
        if (this.getIfAlive())
        {
            vie -= quantiter;
            this.playDamageSound();
            if (this.gfxManager)
            {
                SpriteManager.creerEffetDegat(this.gfxManager,

                                              new Vector3(this.gameObject.transform.position.x,
                                                          this.gameObject.transform.position.y + 1,
                                                          this.gameObject.transform.position.z));
            }
            if (vie <= 0 && this.estLocal)
            {
                GestionnaireMort.getEvent().Invoke(this);
                Debug.Log(this.gameObject.name + " est mort ; transmission au serveur.");
                GestionnaireEvenement.declancherEvenement("JoueurMort");
            }
        }
        GestionnaireEvenement.declancherEvenement("vieChanger");

        //Debug.Log(this.gameObject.name + " " + vie);
    }
Exemplo n.º 2
0
    void onUserDeath(SocketIOEvent obj)
    {
        string     nomJoueur = JsonToString(obj.data.GetField("nomJoueur").ToString(), "\"");
        GameObject joueur    = GameObject.Find(nomJoueur);

        GestionnaireMort.getEvent().Invoke(joueur.GetComponent <VieJoueur>());
    }
Exemplo n.º 3
0
 // onEnable is called when the object is initialized.
 void OnEnable()
 {
     GestionnaireDegats.init();
     GestionnaireMort.init();
     GestionnaireReapparition.init();
     GestionnaireReapparition.ajouterPointsReapparition(GameObject.Find("Respawn1"),
                                                        GameObject.Find("Respawn2"),
                                                        GameObject.Find("Respawn3"),
                                                        GameObject.Find("Respawn4"));
 }
Exemplo n.º 4
0
 // onDisable is called when the object is killed.
 void onDisable()
 {
     GestionnaireMort.remove();
 }