예제 #1
0
 private void Start()
 {
     m_CurrentCamera        = FindObjectOfType <CameraTopDown>();
     m_CurrentCamera.player = prefabPlayer;
     loader = FindObjectOfType <ProgressSceneLoader>();
     loader.DesactiveUI();
     playerLife.health = loader.GetData();
 }
예제 #2
0
    public bool EndQuest()
    {
        //SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);

        ProgressSceneLoader sceneLoader = Global.Component.GetProgressSceneLoader();

        sceneLoader.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);

        return(true);
    }
예제 #3
0
 private void Awake()
 {
     controls = new PlayerControl();
     controls.Enable();
     controls.Gameplay.Yoyo.performed         += ctx => Dash();
     controls.Gameplay.Attack.performed       += ctx => MeleAttack();
     controls.Gameplay.Utilitaire1.performed  += ctx => UseSlotInventory();
     controls.Gameplay.ChangeWeapon.performed += ctx => SwitchWeapon();
     controls.Gameplay.Menu.performed         += ctx => manag.MenuPause();
     controls.Gameplay.Move.performed         += ctx => inputDirMove = ctx.ReadValue <Vector2>();
     controls.Gameplay.Move.canceled          += ctx => inputDirMove = Vector2.zero;
     GetComponent <Health>().OnDie.AddListener(Die);
     anim     = GetComponentInChildren <Animator>();
     rb       = GetComponent <Rigidbody>();
     particle = GetComponentInChildren <ParticleSystem>();
     manag    = FindObjectOfType <LevelManager>();
     loader   = FindObjectOfType <ProgressSceneLoader>();
     tuto     = FindObjectOfType <TuToManager>();
 }
    // Start is called before the first frame update
    void Awake()
    {
        if (!instance)
        {
            instance = this;
            DontDestroyOnLoad(gameObject);
        }
        else
        {
            Destroy(this);
        }

        canvas = GetComponentInChildren <Canvas>(true);
        //var loaders = FindObjectsOfType<ProgressSceneLoader>();

        //if (loaders.Length < 2)
        //    DontDestroyOnLoad(gameObject);
        //else
        //    for (int extra = 1; extra < loaders.Length; extra++)
        //        Destroy(loaders[extra].gameObject);
    }
예제 #5
0
 private void Start()
 {
     loader = FindObjectOfType <ProgressSceneLoader>();
     player = FindObjectOfType <Deplacement>();
 }
예제 #6
0
    public void Play()
    {
        ProgressSceneLoader sceneLoader = Global.Component.GetProgressSceneLoader();

        sceneLoader.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
    }
예제 #7
0
    private void Start()
    {
        PLAYER_SPEED = new DebugCommand("player_speed", "change player speed", "player_speed <float>", (arg) =>
        {
            GameObject player = Global.Obj.GetPlayerGameObject();
            player.GetComponent <PlayerMovement>().speed = float.Parse(arg, CultureInfo.InvariantCulture.NumberFormat);
        });

        FPS = new DebugCommand("fps", "shows fps", "fsp <on/off>", (arg) =>
        {
            GameObject fpsWindow = GameObject.Find("fpsWindow").gameObject;

            if (arg == "on")
            {
                fpsWindow.GetComponent <FPSCounter>().TurnFps(true);
            }
            else if (arg == "off")
            {
                fpsWindow.GetComponent <FPSCounter>().TurnFps(false);
            }
        });

        SCENE_LOAD = new DebugCommand("scene", "change scene", "scene <int>", (arg) =>
        {
            ProgressSceneLoader sceneLoader = Global.Component.GetProgressSceneLoader();
            sceneLoader.LoadScene(int.Parse(arg));
        });

        MOTION_BLUR = new DebugCommand("motion_blur", "change scene", "motion_blur <on/off>", (arg) =>
        {
            Volume volume         = GameObject.Find("Global Volume").GetComponent <Volume>();
            MotionBlur motionBlur = null;

            volume.profile.TryGet(out motionBlur);

            if (arg == "on")
            {
                motionBlur.active = true;
            }
            else if (arg == "off")
            {
                motionBlur.active = false;
            }
        });

        MOTION_BLUR_INTENCITY = new DebugCommand("motion_blur_intensity", "motion blure intencity", "motion_blur_intensity <int>", (arg) =>
        {
            Volume volume         = GameObject.Find("Global Volume").GetComponent <Volume>();
            MotionBlur motionBlur = null;

            volume.profile.TryGet(out motionBlur);

            motionBlur.intensity.value = float.Parse(arg, CultureInfo.InvariantCulture.NumberFormat);
        });

        MOTION_BLUR_CLAMP = new DebugCommand("motion_blur_clamp", "motion blure clamp", "motion_blur_clamp <int>", (arg) =>
        {
            Volume volume         = GameObject.Find("Global Volume").GetComponent <Volume>();
            MotionBlur motionBlur = null;

            volume.profile.TryGet(out motionBlur);

            motionBlur.clamp.value = float.Parse(arg, CultureInfo.InvariantCulture.NumberFormat);
        });;

        commandList = new List <object>
        {
            PLAYER_SPEED,
            FPS,
            SCENE_LOAD,
            MOTION_BLUR,
            MOTION_BLUR_INTENCITY,
            MOTION_BLUR_CLAMP
        };
    }
예제 #8
0
    void StartSequence()
    {
        if (startSequenceNumber < 18)
        {
            switch (startSequenceNumber)
            {
            case 0:
                this.sceneLoader = sceneLoaderObject.GetComponent <ProgressSceneLoader>();
                this.sceneLoader.UpdateBar(ProgressSceneLoader.START_LOADING);
                tc = new TerrainerContent(this);
                break;

            case 2:
                this.sceneLoader.UpdateBar(ProgressSceneLoader.LOAD_RND);
                this.currentSeed = tc.randomGenerator(currentSeed);
                break;

            case 4:
                this.sceneLoader.UpdateBar(ProgressSceneLoader.LOAD_TERRAIN);
                tc.createTerrainObject();
                break;

            case 6:
                this.sceneLoader.UpdateBar(ProgressSceneLoader.LOAD_BIOMES);
                tc.createBiomesAndTextures();
                tc.resetMaps();
                tc.alphaMap.createAlphaMaps(tc);
                break;

            case 8:
                this.sceneLoader.UpdateBar(ProgressSceneLoader.LOAD_BORDERS);
                tc.alphaMap.calcBorders(tc);
                break;

            case 10:
                this.sceneLoader.UpdateBar(ProgressSceneLoader.LOAD_MOUNTAINS);
                tc.MountMap.createMountainsByBorders();
                break;

            case 12:
                this.sceneLoader.UpdateBar(ProgressSceneLoader.LOAD_GAMEOBJECTS);
                tc.DetailsMap.calculateDetailByBiomes();
                tc.TreeMap.calculateTreesByBiomes();
                tc.createPrefabObjects();
                tc.createGameObjects();
                break;

            case 14:
                this.sceneLoader.UpdateBar(ProgressSceneLoader.LOAD_PLAYER);
                tc.createPlayer();
                this.sceneLoader.camera.SetActive(false);
                // the collider have to reinitialized
                tc.BaseTerrainCollider.enabled = false;

                // TODO day-night changing
                //var lightParent = new GameObject();
                //var light = new GameObject();
                //lightParent.transform.position = new Vector3(0, 0, 0);
                //light.transform.position = new Vector3(this.tc.xTerrainRes, 0, this.tc.yTerrainRes);
                //light.transform.LookAt(lightParent.transform.position);

                //var lightComponent = light.AddComponent<Light>();
                //lightComponent.type = LightType.Spot;
                //lightComponent.color = new Color(255,255,0);
                //lightComponent.spotAngle = 130;
                //lightComponent.range = 3000;
                //lightComponent.intensity = 30;

                //lightParent.transform.parent = this.transform;
                //light.transform.parent = lightParent.transform;

                break;

            case 16:
                tc.BaseTerrainCollider.enabled = true;
                // PrefabUtility.CreatePrefab("Assets/SaveData/ProGen/Terrains/" + currentSeed + ".prefab", tc.BaseTerrainObj);
                // PrefabUtility.CreatePrefab("Assets/SaveData/ProGen/World/" + currentSeed + ".prefab", this.gameObject);
                tc = null;
                this.sceneLoader.UpdateBar("");
                this.sceneLoader.gameObject.SetActive(false);
                break;

            default:
                break;
            }
            startSequenceNumber++;
        }
    }