void PreparaFinalComCaptura()
    {
        GameController.g.HudM.DesligaContainerDoInimigo();

        Vector3 maoDoHeroi = GameController.g.Manager.transform
                             .Find("metarig/hips/spine/chest/shoulder_L/upper_arm_L/forearm_L/hand_L/palm_02_L")
                             .transform.position;

        CriatureAlvoDoItem.transform.localScale = Vector3.zero;

        MonoBehaviour.Destroy(
            ParticulasDeSubstituicao.InsereParticulaDoRaio(CriatureAlvoDoItem.transform.position, maoDoHeroi), 2.5f);
        fase = FaseDoAnimaCaptura.cameraDoHeroi;
    }
Ejemplo n.º 2
0
        void PreparaFinalComCaptura()
        {
            Debug.LogError("ota HUd");
            MessageAgregator <MsgPrepareFinalWithCapture> .Publish(new MsgPrepareFinalWithCapture()
            {
                capturado  = CriatureAlvoDoItem,
                capturador = dono
            });

            //GameController.g.HudM.ModoCriature(false);

            Vector3 maoDoHeroi = dono.transform
                                 .Find("metarig/hips/spine/chest/shoulder.L/upper_arm.L/forearm.L/hand.L/palm.02.L")
                                 .transform.position;

            CriatureAlvoDoItem.transform.localScale = Vector3.zero;

            MonoBehaviour.Destroy(
                ParticleOfSubstitution.InsereParticulaDoRaio(CriatureAlvoDoItem.transform.position, maoDoHeroi), 2.5f);
            fase = FaseDoAnimaCaptura.cameraDoHeroi;
        }
Ejemplo n.º 3
0
        // Update is called once per frame
        public bool Update()
        {
            tempoDecorrido += Time.deltaTime;
            switch (fase)
            {
            case FaseDoAnimaCaptura.inicial:

                PetManager enemyManager = FindByOwner.GetManagerEnemy(dono);
                //AplicadorDeCamera.cam.FocarPonto(10, enemyManager.MeuCriatureBase.distanciaCameraLuta);
                CameraApplicator.cam.FocusInPoint(enemyManager.MeuCriatureBase.distanciaCameraLuta);
                int     arredondado = Mathf.RoundToInt(tempoDecorrido);
                Vector3 variacao    = arredondado % 2 == 1 ? Vector3.zero : new Vector3(1.5f, 1.5f, 1.5f);

                if (arredondado != disparado && arredondado < LOOPS)
                {
                    ParticleOfSubstitution.ParticulaSaiDaLuva(CriatureAlvoDoItem.transform.position);

                    MessageAgregator <MsgRequestDamageAnimateWithFade> .Publish(
                        new MsgRequestDamageAnimateWithFade()
                    {
                        animatePet = enemyManager.gameObject
                    }
                        );

                    //animator.CrossFade("dano1", 0);
                    //animator.SetBool("dano1", true);
                    //animator.SetBool("dano2", true);

                    disparado = arredondado;
                }

                if (arredondado >= LOOPS)
                {
                    if (iraCapturar)
                    {
                        PreparaFinalComCaptura();
                        fase = FaseDoAnimaCaptura.cameraDoHeroi;
                    }
                    else
                    {
                        PreparaFinalSemCaptura();
                        fase = FaseDoAnimaCaptura.finalizaSemCapturar;
                    }

                    tempoDecorrido = 0;
                }

                CriatureAlvoDoItem.transform.localScale = Vector3.Lerp(
                    CriatureAlvoDoItem.transform.localScale, variacao, Time.deltaTime);

                break;

            case FaseDoAnimaCaptura.finalizaSemCapturar:
                if (tempoDecorrido > 1)
                {
                    return(false);
                }
                break;

            case FaseDoAnimaCaptura.cameraDoHeroi:
                if (tempoDecorrido > 1.5f)
                {
                    CameraApplicator.cam.StartShowPointCamera(dono.transform, new SinglePointCameraProperties()
                    {
                        velOrTimeFocus  = .85f,
                        characterHeight = 1.75f,
                        withTime        = true
                    });
                    //AplicadorDeCamera.cam.InicializaCameraExibicionista(GameController.g.Manager.transform);
                    fase           = FaseDoAnimaCaptura.animaPersonagemCapturando;
                    tempoDecorrido = 0;
                }
                break;

            case FaseDoAnimaCaptura.animaPersonagemCapturando:
                if (tempoDecorrido > 1)
                {
                    PetManager P = FindByOwner.GetManagerEnemy(dono);
                    animaPose = new AnimateCapturePose(P.MeuCriatureBase, dono);
                    MonoBehaviour.Destroy(P.gameObject);
                    fase = FaseDoAnimaCaptura.finalizaCapturando;
                }
                break;

            case FaseDoAnimaCaptura.finalizaCapturando:
                if (!animaPose.Update())
                {
                    return(false);
                }
                break;
            }

            return(true);
        }
    // Update is called once per frame
    public bool Update()
    {
        tempoDecorrido += Time.deltaTime;
        switch (fase)
        {
        case FaseDoAnimaCaptura.inicial:
            AplicadorDeCamera.cam.FocarPonto(10, GameController.g.InimigoAtivo.MeuCriatureBase.distanciaCameraLuta);
            int     arredondado = Mathf.RoundToInt(tempoDecorrido);
            Vector3 variacao    = arredondado % 2 == 1 ? Vector3.zero : new Vector3(1.5f, 1.5f, 1.5f);

            if (arredondado != disparado && arredondado < LOOPS)
            {
                ParticulasDeSubstituicao.ParticulaSaiDaLuva(CriatureAlvoDoItem.transform.position);

                animator.CrossFade("dano1", 0);
                animator.SetBool("dano1", true);
                animator.SetBool("dano2", true);

                disparado = arredondado;
            }

            if (arredondado >= LOOPS)
            {
                if (iraCapturar)
                {
                    PreparaFinalComCaptura();
                    fase = FaseDoAnimaCaptura.cameraDoHeroi;
                }
                else
                {
                    PreparaFinalSemCaptura();
                    fase = FaseDoAnimaCaptura.finalizaSemCapturar;
                }

                tempoDecorrido = 0;
            }

            CriatureAlvoDoItem.transform.localScale = Vector3.Lerp(
                CriatureAlvoDoItem.transform.localScale, variacao, Time.deltaTime);

            break;

        case FaseDoAnimaCaptura.finalizaSemCapturar:
            if (tempoDecorrido > 1)
            {
                return(false);
            }
            break;

        case FaseDoAnimaCaptura.cameraDoHeroi:
            if (tempoDecorrido > 1.5f)
            {
                AplicadorDeCamera.cam.InicializaCameraExibicionista(GameController.g.Manager.transform);
                fase           = FaseDoAnimaCaptura.animaPersonagemCapturando;
                tempoDecorrido = 0;
            }
            break;

        case FaseDoAnimaCaptura.animaPersonagemCapturando:
            if (tempoDecorrido > 1)
            {
                animaPose = new AnimaPoseDeCaptura(GameController.g.InimigoAtivo.MeuCriatureBase);
                MonoBehaviour.Destroy(GameController.g.InimigoAtivo.gameObject);
                fase = FaseDoAnimaCaptura.finalizaCapturando;
            }
            break;

        case FaseDoAnimaCaptura.finalizaCapturando:
            if (!animaPose.Update())
            {
                return(false);
            }
            break;
        }

        return(true);
    }