Пример #1
0
        public void InitScene(Device device, DeviceContext deviceContext, IRenderSurface renderSurface)
        {
            SceneRenderer.Init(renderSurface, device);
            m_cameraBuffer.Init(device);
            m_cubeCameraBuffer.Init(device);

            LightManager.Init(device, deviceContext);
        }
Пример #2
0
    async Task Init()
    {
        state = State.Loading;
        await loader.LoadWrapper();

        if (state == State.Error)
        {
            return;
        }
        stopwatch.Start();
        state         = State.Initializing;
        detailedState = "Initializing sectors";
        await WaitIfNecessary();

        sectorManager.Init();
        detailedState = "Initializing graphs";
        await WaitIfNecessary();

        graphManager.Init();
        detailedState = "Initializing lights";
        await WaitIfNecessary();

        lightManager.Init();
        detailedState = "Initializing persos";
        await InitPersos();

        sectorManager.InitLights();
        detailedState = "Initializing camera";
        await WaitIfNecessary();

        InitCamera();
        detailedState = "Initializing portals";
        await WaitIfNecessary();

        portalManager.Init();

        /*if (viewCollision)*/
        UpdateViewCollision();
        if (loader.cinematicsManager != null)
        {
            detailedState = "Initializing cinematics";
            await new WaitForEndOfFrame();
            InitCinematics();
        }
        detailedState = "Finished";
        stopwatch.Stop();
        state = State.Finished;
        loadingScreen.Active = false;

        if (ExportAfterLoad)
        {
            MapExporter e = new MapExporter(this.loader, ExportPath);
            e.Export();

            Application.Quit();
        }
    }
Пример #3
0
 public void InitLight()
 {
     // 暂时取第一束
     for (int i = 0; i < 1; ++i)
     {
         GameObject   light    = Instantiate(ResourcesTools.getLight(1));
         LightManager lightMgr = light.GetComponent <LightManager>();
         lightMgr.Init(RoomData.room.Speed, RoomData.room.Count, RoomData.room.Lights[i].X, RoomData.room.Lights[i].Z);
         lights.Add(light);
     }
 }
Пример #4
0
    public override void onSkill()
    {
        AnimationControl anim = GetComponent <AnimationControl>();

        anim.Attack();
        if (RoomData.isMainRole(playerAttribute.seat))
        {
            FightScene.instance.audioController.SoundPlay(AudioEunm.attack);
        }
        GameObject   light    = Instantiate(ResourcesTools.getLight(1));
        LightManager lightMgr = light.GetComponent <LightManager>();

        float speed = ((RoomData.room.Speed + playerAttribute.bounces * speedCoeff) > lightMgr.speedRange[lightMgr.speedRange.Length - 1]) ?
                      lightMgr.speedRange[lightMgr.speedRange.Length - 1] : (RoomData.room.Speed + playerAttribute.bounces * speedCoeff);

        lightMgr.Init(speed, RoomData.room.Count, gameObject);
        FightScene.instance.Lights.Add(light);
    }
Пример #5
0
    // Use this for initialization
    void Start()
    {
        // Read command line arguments
        string[] args = System.Environment.GetCommandLineArgs();
        for (int i = 0; i < args.Length; i++)
        {
            switch (args[i])
            {
            case "--lvl":
            case "-l":
                lvlName = args[i + 1];
                i++;
                break;

            case "--folder":
            case "--directory":
            case "-d":
            case "-f":
                gameDataBinFolder = args[i + 1];
                i++;
                break;

            case "--mode":
            case "-m":
                switch (args[i + 1])
                {
                case "r3_gc":
                    mode = MapLoader.Mode.Rayman3GC; break;

                case "ra_gc":
                    mode = MapLoader.Mode.RaymanArenaGC; break;

                case "r3_pc":
                    mode = MapLoader.Mode.Rayman3PC; break;

                case "ra_pc":
                    mode = MapLoader.Mode.RaymanArenaPC; break;

                case "r2_pc":
                    mode = MapLoader.Mode.Rayman2PC; break;
                }
                break;
            }
        }

        loader      = MapLoader.Loader;
        loader.mode = mode;
        loader.gameDataBinFolder              = gameDataBinFolder;
        loader.lvlName                        = lvlName;
        loader.allowDeadPointers              = allowDeadPointers;
        loader.forceDisplayBackfaces          = forceDisplayBackfaces;
        loader.baseMaterial                   = baseMaterial;
        loader.baseTransparentMaterial        = baseTransparentMaterial;
        loader.baseBlendMaterial              = baseBlendMaterial;
        loader.baseBlendTransparentMaterial   = baseBlendTransparentMaterial;
        loader.negativeLightProjectorMaterial = negativeLightProjectorMaterial;
        loader.baseLightMaterial              = baseLightMaterial;

        loader.Load();
        sectorManager.Init();
        lightManager.Init();
        InitPersos();
        if (viewCollision)
        {
            UpdateViewCollision();
        }
    }