Пример #1
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;
        }
Пример #2
0
        void PreparaFinalSemCaptura()
        {
            ParticleOfSubstitution.ParticulaSaiDaLuva(CriatureAlvoDoItem.transform.position, GeneralParticles.captureEscape);
            CriatureAlvoDoItem.transform.localScale = new Vector3(1, 1, 1);
            //animator.SetBool("dano1", false);
            //animator.SetBool("dano2", false);
            MessageAgregator <MsgEndDamageState> .Publish(new MsgEndDamageState()
            {
                gameObject = CriatureAlvoDoItem
            });

            Debug.LogError("ota HUd");

            MessageAgregator <MsgRequestRapidInfo> .Publish(new MsgRequestRapidInfo()
            {
                message = string.Format(TextBank.RetornaFraseDoIdioma(TextKey.tentaCapturar),
                                        PetBase.NomeEmLinguas(FindByOwner.GetManagerEnemy(dono).MeuCriatureBase.NomeID))
            });

            //GameController.g.HudM.Painel.AtivarNovaMens(
            //   GameController.g.InimigoAtivo.MeuCriatureBase.NomeEmLinguas + BancoDeTextos.RetornaFraseDoIdioma(ChaveDeTexto.tentaCapturar),
            //    24, 5);
        }
Пример #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);
        }