Exemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     _SettingsValue = GetComponentInChildren <Text>();
     StickMovement  = new bool[2] {
         false, false
     };
     m_ManagerInstance = GameManagerc.Instance;
 }
Exemplo n.º 2
0
    // Use this for initialization
    void Awake()
    {
        m_LMSDingSound = Resources.Load("Audio/SFX/Point_LastManStanding_001") as AudioClip;
        m_HHDingSound  = Resources.Load("Audio/SFX/Point_HeadHunters_001") as AudioClip;

        m_GlitchEffect = Resources.Load("Audio/SFX/glitch-sound-effect") as AudioClip;
        m_GlitchEffect.LoadAudioData();
        m_AudioSource = this.GetComponent <AudioSource>();
        _rbPausers    = new List <RigidbodyPauser>();


        if (!m_AudioSource)
        {
            m_AudioSource      = this.gameObject.AddComponent <AudioSource>();
            m_AudioSource.clip = m_LMSDingSound;
            m_AudioSource.outputAudioMixerGroup = AudioManager.RequestMixerGroup(SourceType.SFX);
        }

        StartCoroutine(SetInitalAudio());


        //SingletonTester.Instance.AddSingleton(this);
        InstanceCreated = true;
        //Find the
        DontDestroyOnLoad(this.gameObject);
        //DeathmatchTimer = new Timer(m_fTimedDeathMatchTime);
        waitForRoundEnd = new Timer(m_fTimeAfterPoints);
        mInstance       = GameManagerc.Instance;
        if (mInstance.gameObject != this.gameObject)
        {
            Destroy(this.gameObject);
        }
        else
        {
            mbInstanceIsMe            = true;
            SceneManager.sceneLoaded += OnSceneLoaded;
        }

        m_bRoundOver    = false;
        Physics.gravity = new Vector3(0, 0, 10); //why
        m_bRoundReady   = true;
    }
Exemplo n.º 3
0
    /// <summary>
    /// used to reutn to the character selection screen
    /// </summary>
    public void GoToStart()
    {
        Time.timeScale = 1;
        if (!screenTransition)
        {
            screenTransition = FindObjectOfType <ScreenTransition>();
        }
        for (int i = 0; i < screenTransition.transform.childCount; i++)
        {
            screenTransition.transform.GetChild(i).GetComponent <Image>().enabled = true;
        }
        if (FindObjectOfType <ScreenTransition>())
        {
            FindObjectOfType <ScreenTransition>().CloseDoor();
        }
        CameraControl.mInstance.enabled = false;
        Destroy(CameraControl.mInstance);
        //CameraControl.mInstance.m_Targets.Clear();
        //clear the players list
        for (int i = 0; i < InGamePlayers.Count; i++)
        {
            InGamePlayers[i].Clear();
            InGamePlayers[i].gameObject.SetActive(false);
            Destroy(InGamePlayers[i].gameObject, 1);
        }
        InGamePlayers = new List <PlayerStatus>();

        //Quite literally a deconstrucotr
        PlayerWins.Clear();
        PlayerWins = new Dictionary <PlayerStatus, int>();
        InGamePlayers.Clear();
        InGamePlayers = new List <PlayerStatus>();
        m_gameMode    = Gamemode_type.LAST_MAN_STANDING_DEATHMATCH;
        //FindObjectOfType<ScreenTransition>().CloseDoor();
        mInstance               = null;
        FinishUIPanel           = null;
        m_bRoundOver            = false;
        MapToLoad               = null;
        PointSprite             = null;
        PointContainers         = null;
        PointsPanel             = null;
        InGameScreenAnimator    = null;
        mbFinishedShowingScores = false;
        //  MenuPanel.SetActive(true);
        //mbLoadedIntoGame = false;
        mbInstanceIsMe = false;
        //mbFinishedPanelShown = false;
        mbMapLoaded         = false;
        m_bGamePaused       = false;
        m_bFirstTimeLoading = true;
        m_bDoReadyKill      = true;
        m_bDoGlitch         = true;
        //UIManager.Instance.gameObject.SetActive(false);
        ControllerManager.Instance.gameObject.SetActive(false);
        CharacterSelectionManager.Instance.gameObject.SetActive(false);

        //PlayerUIArray.Instance.gameObject.SetActive(false);

        UINavigation.Instance.gameObject.SetActive(false);
        //Destroy the singleton objects

        ///Destroy(PlayerUIArray.Instance.gameObject);
        Destroy(GameAudioPicker.Instance);
        Destroy(UINavigation.Instance);
        Destroy(CharacterSelectionManager.Instance);
        Destroy(ControllerManager.Instance);
        //Destroy(UIManager.Instance);
        Destroy(GameAudioPicker.Instance.gameObject);
        GetComponent <MusicFader>().FadeOut();
        StartCoroutine(ReturnToMenu());
        //Destroy(GameManagerc.Instance);
        //Destroy(this.gameObject);
    }