Beispiel #1
0
 public void UsePrimaryGadget(int newAmount, Vector2 dir, Vector3 origin)
 {
     //Checks primarily assign gadget and uses them
     switch (primaryGadget)
     {
     case GadgetTypes.FlashBang:
         FlashBang flashBang = Instantiate(flashBangPrefab, origin, Quaternion.identity).GetComponent <FlashBang>();
         flashBang.LaunchFlashBang(dir, throwForce);
         UIManager.instance.gadgetDisplay.DecreaseRespectiveGadgetCounter(primaryGadget);
         break;
     }
 }
Beispiel #2
0
    void Teleport()
    {
        if (audioSource != null)
        {
            audioSource.PlayOneShot(enterSound);
        }

        FlashBang fb = GameObject.Find("FlashPanel").GetComponent <FlashBang>();

        fb.Flash();

        GameObject player = GameObject.FindWithTag("Player");

        player.transform.position = destination.position;
    }
Beispiel #3
0
    void EnterNextScene()
    {
        Player player = GameObject.FindWithTag("Player").GetComponent <Player>();

        player.Hide();
        player.Lock();

        if (audioSource != null)
        {
            audioSource.PlayOneShot(enterSound);
        }

        if (flashScreen)
        {
            FlashBang fb = GameObject.Find("FlashPanel").GetComponent <FlashBang>();
            fb.Flash();
        }

        Wait(1, () => {
            SceneManager.LoadScene(nextScene, LoadSceneMode.Single);
            //player.Show();
            //player.Unlock();
        });
    }
Beispiel #4
0
    public void SetShootEnermyEffect()
    {
        Aim componentInChildren = GetComponentInChildren <Aim>();

        if (null != componentInChildren)
        {
            componentInChildren.SetShootEnermyEffect();
        }
        else
        {
            MeleeWeapon componentInChildren2 = rightHand.GetComponentInChildren <MeleeWeapon>();
            if (componentInChildren2 != null)
            {
                componentInChildren2.SetShootEnermyEffect();
            }
            else
            {
                Grenade componentInChildren3 = rightHand.GetComponentInChildren <Grenade>();
                if (componentInChildren3 != null)
                {
                    componentInChildren3.SetShootEnermyEffect();
                }
                else
                {
                    FlashBang componentInChildren4 = rightHand.GetComponentInChildren <FlashBang>();
                    if (componentInChildren4 != null)
                    {
                        componentInChildren4.SetShootEnermyEffect();
                    }
                    else
                    {
                        SmokeGrenade componentInChildren5 = rightHand.GetComponentInChildren <SmokeGrenade>();
                        if (componentInChildren5 != null)
                        {
                            componentInChildren5.SetShootEnermyEffect();
                        }
                        else
                        {
                            SenseBomb componentInChildren6 = rightHand.GetComponentInChildren <SenseBomb>();
                            if (componentInChildren6 != null)
                            {
                                componentInChildren6.SetShootEnermyEffect();
                            }
                            else
                            {
                                XmasBomb componentInChildren7 = rightHand.GetComponentInChildren <XmasBomb>();
                                if (componentInChildren7 != null)
                                {
                                    componentInChildren7.SetShootEnermyEffect();
                                }
                                else
                                {
                                    PoisonBomb componentInChildren8 = rightHand.GetComponentInChildren <PoisonBomb>();
                                    if (componentInChildren8 != null)
                                    {
                                        componentInChildren8.SetShootEnermyEffect();
                                    }
                                    else
                                    {
                                        GetComponent <LocalController>().SetShootEnermyEffect();
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }