Example #1
0
        protected void FacaImpacto(GameObject emQ, bool destroiAqui = true, bool noTransform = false)
        {
            if (noTransform)
            {
                InsertImpactView.Insert(noImpacto, transform.position, Qparticles);
            }
            else
            {
                InsertImpactView.Insert(noImpacto, emQ.transform.position, Qparticles);
            }

            DamageManager.VerificaDano(emQ, dono, esseGolpe);

            MessageAgregator <MsgRequest3dSound> .Publish(new MsgRequest3dSound()
            {
                sender = emQ.transform,
                sfxId  = esseGolpe.SomDoImpacto
            });

            if (destroiAqui)
            {
                Destroy(gameObject);
            }

            #region suprimido

            //Debug.LogError("fazer get prefab de impacto");
            //GameObject impacto=null;
            //GameObject impacto = GameController.g.El.retorna(noImpacto);


            //if (!noTransform)
            //    impacto = Instantiate(impacto, transform.position, Qparticles);



            //if (noTransform)
            //    impacto = Instantiate(impacto, emQ.transform.position, Qparticles);


            //if (impacto)
            //    Destroy(impacto, 1.5f);
            #endregion
        }
Example #2
0
        void OnTriggerEnter(Collider emQ)
        {
            if (emQ.tag == "Criature" || emQ.tag == "Player")
            {
                bool dano   = true;
                bool deFogo = false;
                if (emQ.tag == "Criature")
                {
                    PetTypeName[] Tipos = emQ.transform.GetComponent <PetManager>().MeuCriatureBase.PetFeat.meusTipos;
                    for (int i = 0; i < Tipos.Length; i++)
                    {
                        if (Tipos[i] == tipoImune)
                        {
                            dano   = false;
                            deFogo = true;
                        }
                    }
                }
                else
                {
                    dano = false;
                }

                if (!deFogo)
                {
                    GameObject G = Resources.Load <GameObject>("particles/" + noImpacto.ToString());//GameController.g.El.retorna(noImpacto);
                    G = (GameObject)Instantiate(G, emQ.transform.position, Quaternion.identity);

                    Destroy(G, 0.75f);
                }

                if (dano)
                {
                    DamageManager.VerificaDano(emQ.gameObject, emQ.gameObject, new PetAttackBase(new PetAttackFeatures()));
                    //Dano.VerificaDano(emQ.gameObject, emQ.gameObject, new GolpeBase(new ContainerDeCaracteristicasDeGolpe()));
                }

                if (!deFogo)
                {
                    Destroy(gameObject);
                }
            }
        }