예제 #1
0
    public void ajouteEffetCase(Effet e, Case ca, Personnage lanceur)
    {
        GameObject nobj = (GameObject)GameObject.Instantiate(e.image);

        nobj.transform.position   = new Vector3(ca.getX(), -ca.getY(), -2);
        nobj.transform.localScale = new Vector3(1f, 1f, 1f);
        nobj.transform.parent     = effectHolder;
        e.addComponent(nobj);
        Effet effet = nobj.GetComponent <Effet>();

        effet.copy(e);
        ca.Effet.Add(effet);
        effet.C       = ca;
        effet.Lanceur = lanceur;
        lanceur.effetLance.Add(effet);
        effet.InstanceImage = nobj;
    }
예제 #2
0
    public void ajouteEffetJoueur(Effet e, Case ca, Personnage lanceur)
    {
        GameObject nobj = (GameObject)GameObject.Instantiate(e.image);

        nobj.transform.position   = new Vector3(ca.getX(), -ca.getY(), -2);
        nobj.transform.localScale = new Vector3(1f, 1f, 1f);
        nobj.transform.parent     = ca.perso.gameObject.transform;
        e.addComponent(nobj);
        Effet effet = nobj.GetComponent <Effet>();

        effet.copy(e);
        effet.InstanceImage = nobj;
        effet.Victime       = ca.perso;
        effet.Lanceur       = lanceur;
        ca.perso.effetsRecu.Add(effet);
        lanceur.effetLance.Add(effet);
        if (effet.timeEffect == TimeEffect.Constant)
        {
            effet.applyEffect();
        }
    }