Exemplo n.º 1
0
    public void retornaOMovimento()
    {
        if (nav == null)
        {
            nav       = gameObject.AddComponent <NavMeshAgent>();
            nav.speed = C.velocidadeAndando;
        }

        if (statusTemporarioBase.contemStatus(tipoStatus.paralisado, C) > -1)
        {
            nav.speed = C.velocidadeAndando / 5;
        }

        if (siga == null)
        {
            siga = gameObject.AddComponent <sigaOLider>();
        }
        else
        {
            siga.enabled = true;
        }


        if (!GameObject.Find("CriatureAtivo"))
        {
            siga.lider = transform;
        }
        else
        {
            siga.lider = alvo;
        }
    }
Exemplo n.º 2
0
    static void VerificaVida(GameObject atacante, CreatureManager doAtacado, Animator a)
    {
        if (doAtacado.MeuCriatureBase.CaracCriature.meusAtributos.PV.Corrente <= 0)
        {
            a.SetBool("cair", true);

            sigaOLider s = a.GetComponent <sigaOLider>();
            if (s)
            {
                s.enabled = false;
            }

            UnityEngine.AI.NavMeshAgent nav = a.GetComponent <UnityEngine.AI.NavMeshAgent>();
            if (nav.enabled)
            {
                nav.Stop();// nav.isStopped = true;
            }

            /*   doAtacado.MudaParaDerrotado();
             *
             * if (!doAtacado.gerenteCri)
             * {
             *     AplicaSelvagemDerrotado aSD =  doAtacado.gameObject.AddComponent<AplicaSelvagemDerrotado>();
             *     aSD.oDerrotado = doAtacado;
             *     aSD.oQDerrotou = atacante.GetComponent<GerenciadorDeCriature>();
             *
             * }
             * else
             * {
             *     //Morte de um criature selvagem
             * }
             */
        }
    }
Exemplo n.º 3
0
    // Update is called once per frame
    void Update()
    {
        if (iniciou)
        {
            tempoDecorrido += Time.deltaTime;
            switch (fase)
            {
            case fasesDaQueda.animaInicial:
                if (tempoDecorrido < 0.5f)
                {
                    mB.transform.position -= 5 * Vector3.up * Time.deltaTime;
                }
                else
                {
                    tempoDecorrido = 0;
                    p    = gameObject.AddComponent <pretoMorte>();
                    fase = fasesDaQueda.colocouPretoMorte;
                }
                break;

            case fasesDaQueda.colocouPretoMorte:
                if (tempoDecorrido > 1f)
                {
                    animator.Play("damage_25");
                    p.entrando            = false;
                    fase                  = fasesDaQueda.tiraPretoMorte;
                    mB.transform.position = posAlvo;
                }
                break;

            case fasesDaQueda.tiraPretoMorte:
                if (mB.noChao(mB.Y.distanciaFundamentadora))
                {
                    animator.Play("getup_20_p");
                    Transform T = GameObject.Find("CriatureAtivo").transform;
                    nav          = T.GetComponent <NavMeshAgent>();
                    siga         = T.GetComponent <sigaOLider>();
                    siga.enabled = false;
                    nav.enabled  = false;
                    T.position   = posAlvo;
                    fase         = fasesDaQueda.levantando;
                }
                break;

            case fasesDaQueda.levantando:
                if (tempoDecorrido > 0.25f)
                {
                    movimentoBasico.retornarFluxoHeroi();
                    iniciou      = false;
                    fase         = fasesDaQueda.animaInicial;
                    nav.enabled  = true;
                    siga.enabled = true;
                }
                break;
            }
        }
    }
Exemplo n.º 4
0
    public void retornaOMovimento()
    {
        if(nav == null){
            nav = gameObject.AddComponent<NavMeshAgent>();
            nav.speed = C.velocidadeAndando;
        }

        if(statusTemporarioBase.contemStatus(tipoStatus.paralisado,C)>-1)
            nav.speed = C.velocidadeAndando/5;

        if(siga == null)
            siga = gameObject.AddComponent<sigaOLider>();
        else
            siga.enabled = true;

        if(!GameObject.Find("CriatureAtivo"))
            siga.lider = transform;
        else
            siga.lider = alvo;
    }
Exemplo n.º 5
0
    // Update is called once per frame
    void Update()
    {
        if(iniciou)
        {
            tempoDecorrido+=Time.deltaTime;
            switch(fase)
            {
            case fasesDaQueda.animaInicial:
                if(tempoDecorrido<0.5f)
                {
                    mB.transform.position -= 5*Vector3.up*Time.deltaTime;
                }else
                {
                    tempoDecorrido = 0;
                    p = gameObject.AddComponent<pretoMorte>();
                    fase = fasesDaQueda.colocouPretoMorte;
                }
            break;
            case fasesDaQueda.colocouPretoMorte:
                if(tempoDecorrido>1f)
                {
                    animator.Play("damage_25");
                    p.entrando = false;
                    fase = fasesDaQueda.tiraPretoMorte;
                    mB.transform.position = posAlvo;
                }
            break;
            case fasesDaQueda.tiraPretoMorte:
                if(mB.noChao(mB.Y.distanciaFundamentadora))
                {
                    animator.Play("getup_20_p");
                    Transform T = GameObject.Find("CriatureAtivo").transform;
                    nav = T.GetComponent<NavMeshAgent>();
                    siga = T.GetComponent<sigaOLider>();
                    siga.enabled = false;
                    nav.enabled = false;
                    T.position = posAlvo;
                    fase = fasesDaQueda.levantando;
                }
            break;
            case fasesDaQueda.levantando:
                if(tempoDecorrido>0.25f)
                {
                    movimentoBasico.retornarFluxoHeroi();
                    iniciou = false;
                    fase = fasesDaQueda.animaInicial;
                    nav.enabled = true;
                    siga.enabled = true;
                }
            break;
            }

        }
    }