Esempio n. 1
0
    private void Start()
    {
        mainCam_ = Camera.main;

        transform_ = transform;
        player_    = GetComponent <PlayableCharacterScript>();
        SceneGlobals.NullCheck(player_);
        map_ = SceneGlobals.Instance.MapScript;

        TrackedPath.Rewind();
    }
Esempio n. 2
0
        void Start()
        {
//			if (mainCanvas == null) {
//				mainCanvas = GameObject.FindGameObjectWithTag("Canvas");
//			}

            string loadingLocation = SceneGlobals.getLodingLocation();

            if (loadingLocation == "f1_startElevator1" || loadingLocation == "f2_startElevator1" || loadingLocation == "f3_startElevator1" || SceneGlobals.getLodingLocation() == null)
            {
                openElevator();
            }
        }
Esempio n. 3
0
    public void AdjustSFxVolume(Single volume)
    {
        SFxVolume = volume;
        PlayerPrefs.SetFloat(PlayerPrefsNames.SfxVolume, SFxVolume);
        SceneGlobals globals = SceneGlobals.Instance;

        globals.AudioManager.StopMusic();
        globals.AudioManager.StopAmbience();
        StartCoroutine(globals.AudioManager.SetAudioProfile(AudioManager.eScene.InMenuSetSfxVolume));
        isMusicPlaying        = false;
        isAmbientSoundPlaying = false;
        globals.AudioManager.PlaySfxClip(globals.AudioManager.AudioClips.ShotgunShot, 1);
    }
Esempio n. 4
0
    public void AdjustAmbientVolume(Single volume)
    {
        AmbientVolume = volume;
        PlayerPrefs.SetFloat(PlayerPrefsNames.AmbientVolume, AmbientVolume);
        SceneGlobals globals = SceneGlobals.Instance;

        globals.AudioManager.StopMusic();
        StartCoroutine(globals.AudioManager.SetAudioProfile(AudioManager.eScene.InMenuSetAmbientVolume));
        isMusicPlaying = false;
        if (!isAmbientSoundPlaying)
        {
            isAmbientSoundPlaying = true;
            globals.AudioManager.PlayAmbience(globals.AudioManager.AudioClips.Campfire, true);
        }
    }
Esempio n. 5
0
    public void AdjustMusicVolume(Single volume)
    {
        MusicVolume = volume;
        PlayerPrefs.SetFloat(PlayerPrefsNames.MaxMusicVolume, MusicVolume);
        SceneGlobals globals = SceneGlobals.Instance;

        StartCoroutine(globals.AudioManager.SetAudioProfile(AudioManager.eScene.InMenuSetMusicVolume));
        if (!isMusicPlaying)
        {
            isMusicPlaying = true;
            globals.AudioManager.PlayMusic(globals.AudioManager.AudioClips.IntroMusic);
        }
        globals.AudioManager.StopAmbience();
        isAmbientSoundPlaying = false;
    }
Esempio n. 6
0
    void Start()
    {
        startposition = SceneGlobals.getLodingLocation();

        if (startposition != null)
        {
            if (tag == "VRPlayer")
            {
                if (startposition == "f1_startStairf2")
                {
                    GameObject startEmpty = GameObject.Find(startposition);
                    Vector3    startpos   = startEmpty.transform.position;
                    gameObject.transform.position = new Vector3(startpos.x, 5.888391f, startpos.z);
                    gameObject.transform.rotation = startEmpty.transform.rotation;
                }
                else if (startposition == "f1_startStairf3")
                {
                    GameObject startEmpty = GameObject.Find(startposition);
                    Vector3    startpos   = startEmpty.transform.position;
                    gameObject.transform.position = new Vector3(startpos.x, 12.77867f, startpos.z);
                    gameObject.transform.rotation = startEmpty.transform.rotation;
                }
                else
                {
                    Debug.Log("StartPosition " + startposition);
                    GameObject startEmpty = GameObject.Find(startposition);
                    Vector3    startpos   = startEmpty.transform.position;
//				gameObject.transform.position = new Vector3 (startpos.x, startpos.y + yOffset, startpos.z);
                    gameObject.transform.position = new Vector3(startpos.x, gameObject.transform.position.y, startpos.z);
//						gameObject.transform.position = startEmpty.transform.position;
                    gameObject.transform.rotation = startEmpty.transform.rotation;
                }
            }
            else if (tag == "Player")
            {
                GameObject startEmpty = GameObject.Find(startposition);
                Vector3    startpos   = startEmpty.transform.position;
                //				gameObject.transform.position = new Vector3 (startpos.x, startpos.y + yOffset, startpos.z);
                //gameObject.transform.position = new Vector3 (startpos.x, gameObject.transform.position.y, startpos.z);
                gameObject.transform.position = startEmpty.transform.position;
                gameObject.transform.rotation = startEmpty.transform.rotation;
            }
        }
    }
Esempio n. 7
0
    public bool SetCharacterToHumanControlled(string characterTag, bool showChangeEffect = false)
    {
        var toBeControlled = GameObject.FindWithTag(characterTag)?.GetComponent <PlayableCharacterScript>();

        SceneGlobals.NullCheck(toBeControlled, "toBeControlled");

        var alreadyControlled = playerInScene_;

        bool noChange = alreadyControlled?.tag == toBeControlled.tag;

        if (noChange)
        {
            return(false);
        }

        alreadyControlled?.SetIsHumanControlled(false);
        toBeControlled.SetIsHumanControlled(true, constraints: RigidbodyConstraints2D.FreezeRotation, showChangeEffect);
        playerInScene_ = toBeControlled;

        return(true);
    }
Esempio n. 8
0
    private void NotLoadingRelated()
    {
        // What we can do right away
        SceneGlobals.Refresh();
        SceneGlobals.main_canvas      = GameObject.Find("MainCanvas").GetComponent <Canvas>();
        SceneGlobals.map_canvas       = GameObject.Find("MapCanvas").GetComponent <Canvas>();
        SceneGlobals.permanent_canvas = GameObject.Find("PermanentCanvas").GetComponent <Canvas>();
        SceneGlobals.map_drawer       = Loader.EnsureComponent <MapDrawer>(gameObject);
        SceneGlobals.general          = this;

        uiscript             = Loader.EnsureComponent <GUIScript>(gameObject);
        map_core             = Loader.EnsureComponent <MapCore>(gameObject);
        SceneGlobals.console = console = SceneGlobals.permanent_canvas.GetComponentInChildren <ConsoleBehaviour>();
        console.Start_();
        console.ConsolePos = ConsolePosition.lower;

        // Configure the cameras
        ship_camera = GameObject.Find("ShipCamera").GetComponent <Camera>();
        if (ship_camera == null)
        {
            Debug.LogError("NO ShipCamera");
        }
        ship_camera.farClipPlane = 1e9f;
        Loader.EnsureComponent <CameraMovement>(ship_camera.gameObject);
        map_camera = GameObject.Find("MapCamera").GetComponent <Camera>();
        SceneGlobals.ship_camera = ship_camera;
        SceneGlobals.map_camera  = map_camera;

        // Initialize the audio source
        GameObject audiosource_object = new GameObject("Audio Source");

        audiosource_object.transform.SetParent(ship_camera.transform);
        Globals.audio = Loader.EnsureComponent <AudioManager>(audiosource_object);

        // Get the map view manager
        map_core.Start_();
        SceneGlobals.map_core = map_core;

        SceneGlobals.ui_script = uiscript;
    }
Esempio n. 9
0
    void Awake()
    {
        MapLayer               = LayerMask.NameToLayer("Map");
        PlayerLayer            = LayerMask.NameToLayer("Player");
        PlayerDamageLayer      = LayerMask.NameToLayer("PlayerDamage");
        PlayerInteractionLayer = LayerMask.NameToLayer("PlayerInteraction");
        EnemyLayer             = LayerMask.NameToLayer("Enemy");
        EnemyNoWallsLayer      = LayerMask.NameToLayer("EnemyNoWalls");
        EnemyDamageLayer       = LayerMask.NameToLayer("EnemyDamage");
        DeadEnemyLayer         = LayerMask.NameToLayer("DeadEnemy");
        EnemyDeadOrAliveMask   = (1 << EnemyLayer) + (1 << EnemyNoWallsLayer) + (1 << DeadEnemyLayer);
        EnemyAliveMask         = (1 << EnemyLayer) + (1 << EnemyNoWallsLayer);

        CameraPositioner    = FindObjectOfType <CameraPositioner>();
        CameraShake         = FindObjectOfType <CameraShake>();
        AudioManager        = FindObjectOfType <AudioManager>();
        MapScript           = FindObjectOfType <MapScript>();
        MapAccess           = (IMapAccess)MapScript;
        ParticleScript      = FindObjectOfType <ParticleScript>();
        DebugLinesScript    = FindObjectOfType <DebugLinesScript>();
        LightingImageEffect = FindObjectOfType <LightingImageEffect>();
        LightingCamera      = FindObjectOfType <LightingCamera>();
        MapCamera           = FindObjectOfType <MiniMapCamera>();
        PlayableCharacters  = FindObjectOfType <PlayableCharacters>();
        GraveStoneManager   = FindObjectOfType <GraveStoneManager>();

        NullCheck(MapLayer);
        NullCheck(PlayerLayer);
        NullCheck(PlayerDamageLayer);
        NullCheck(PlayerInteractionLayer);
        NullCheck(EnemyLayer);
        NullCheck(EnemyDamageLayer);
        NullCheck(DeadEnemyLayer);

        Instance = this;
    }
Esempio n. 10
0
 void OnDestroy()
 {
     Instance = null;
 }
//		private void HandHoverUpdate (Hand hand)
//		{
//			if (hand.GetStandardInteractionButtonDown ()) {
//				loadNextLevel ();
//			}
//		}

        void loadNextLevel()
        {
            SceneGlobals.setLoadingLocation(startEmptyName);
            //SceneGlobals.updatePlayerTransform ();
            Application.LoadLevel(selectedLevel);
        }
Esempio n. 12
0
 void PrepareNewScene()
 {
     SceneGlobals.setLoadingLocation(startEmptyName);
     sceneFader.GetComponent <SceneFade>().setLevel(floorIndexToLoad);
     sceneFader.GetComponent <SceneFade>().EndScene();
 }