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; } }
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 * } */ } }
// 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; } } }
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; }
// 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; } } }