void Start()
    {
        BloqueoUp = false;
        VeloUp    = 200;
        VeloDown  = 30;
        contador  = 0;
        Activar   = false;
        band      = true;

        if (DashObject)
        {
            DashParticula = DashObject.GetComponent <ParticleEmitter>();
        }

        if (HumoParadaObject)
        {
            particulaParada = HumoParadaObject.GetComponent <ParticleSystem>();
        }
        rb = GetComponent <Rigidbody>();
    }
Exemple #2
0
    IEnumerator RandomCalls()
    {
        while (true)
        {
            yield return(new WaitForSeconds(Random.Range(PhoneCallRandomness.x, PhoneCallRandomness.y)));

            int     RandomCaller = Random.Range(0, SpamCallers.Count);
            TextBox TB           = null;
            while (!TB)
            {
                yield return(new WaitForSeconds(0.5f));

                TB = GameObject.FindWithTag("TextBox").GetComponent <TextBox>();
            }

            if (!GetComponent <DashObject>().PickedUp&& !GetComponent <DashObject>().Locked&& !InCall && !TB.isActive)
            {
                if (GameObject.FindWithTag("Manager").GetComponent <Manager>().TimeIndex != 0 && GameObject.FindWithTag("Manager").GetComponent <Manager>().TimeIndex < 600)
                {
                    ASC.Sound = PhoneCallSound;
                    ASC.SetVolume(1f);
                    ASC.AS.loop = true;
                    ASC.Play();

                    PhoneNumber      = "";
                    PhoneScreen.text = "Incoming : " + SpamCallers[RandomCaller].CallerID;
                    DashObject DO = GetComponent <DashObject>();

                    int  Frames   = 0;
                    bool Answered = false;
                    while (Frames < (7 * 60))
                    {
                        yield return(null);

                        Frames++;

                        if (DO.PickedUp)
                        {
                            Answered = true;
                            Frames   = 1000;
                        }
                    }

                    if (Answered)
                    {
                        PhoneScreen.text = SpamCallers[RandomCaller].CallerID;
                        InCall           = true;

                        ASC.AS.loop = false;
                        ASC.Stop();


                        TB.CurrentVoice  = SpamCallers[RandomCaller].CallerVoice;
                        TB.CurrentSource = ASC;
                        ASC.SetVolume(1f);

                        int Index = 0;

                        bool HungUp = false;

                        while (Index < SpamCallers[RandomCaller].Lines.Count && HungUp == false)
                        {
                            TB.DisplayText(SpamCallers[RandomCaller].Lines[Index]);

                            while (TB.isPrinting && HungUp == false)
                            {
                                yield return(null);

                                if (!DO.PickedUp)
                                {
                                    HungUp = true;
                                }
                            }

                            /*
                             * Frames = 0;
                             * while(!HungUp && Frames < 30)
                             * {
                             *  yield return null;
                             *  Frames++;
                             *  if(!DO.PickedUp)
                             *  {
                             *      HungUp = true;
                             *  }
                             * }*/

                            Index++;
                        }

                        TB.Toggle();
                        ASC.SetPitch(1f);

                        if (!HungUp)
                        {
                            GetComponent <DashObject>().RemoveFromHands();
                        }

                        Clear();
                        InCall = false;
                    }

                    ASC.AS.loop = false;
                    ASC.Stop();

                    PhoneScreen.text = "";
                }
            }
        }
    }
 public TrackedDash(DashObject dashObject, AbilityInfo data)
 {
     DashObject = dashObject;
     Data       = data;
     Update();
 }
 public static AbilityInfo Data(this DashObject dashObject)
 {
     return(AbilityDatabase.Get(dashObject.GameObject.ObjectName));
 }