Ejemplo n.º 1
0
    void ApareceComHitNoChao(GameObject gameObject)
    {
        if (!addView)
        {
            addView = true;
            CreatureManager aAlvo = (gameObject.name == "CriatureAtivo")
                ?
                                    GameController.g.InimigoAtivo
                :
                                    GameController.g.Manager.CriatureAtivo;

            Transform alvo = (aAlvo != null) ? aAlvo.transform : null;

            Vector3 volta = gameObject.transform.position;

            if (alvo != null)
            {
                volta         = alvo.position;
                DirDeREpulsao = Vector3.ProjectOnPlane(alvo.position - gameObject.transform.position, Vector3.up).normalized;

                bool b = aAlvo.IA.NavAtiva() || aAlvo.Mov.NoChao(aAlvo.MeuCriatureBase.CaracCriature.distanciaFundamentadora); //alvo.GetComponent<Animator>().GetBool("noChao");
                bool c = alvo.GetComponent <CharacterController>().enabled;

                MonoBehaviour.Destroy(
                    MonoBehaviour.Instantiate(
                        GameController.g.El.retorna(noImpacto.ToString()),
                        alvo.position,
                        Quaternion.identity),
                    10);

                Debug.Log("hitNoChao: " + b + " : " + c);
                if (b && c)
                {
                    Dano.VerificaDano(aAlvo.gameObject, gameObject, this);
                }
            }

            MonoBehaviour.Destroy(
                MonoBehaviour.Instantiate(
                    GameController.g.El.retorna(Nome.ToString()),
                    volta,
                    Quaternion.identity),
                10);

            gameObject.transform.position = new melhoraPos().novaPos(volta);
            ApareceDesaparece(true, gameObject);
        }
    }
 public CaracteristicasDeImpacto(Trails trail, NoImpacto noImpacto, bool parentearOsso)
 {
     nomeTrail            = trail.ToString();
     this.noImpacto       = noImpacto.ToString();
     this.parentearNoOsso = parentearOsso;
 }