Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VR-Klassenzimmer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Container Registry
Model registry
Monitor
Incidents
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mm_vr
VR-Klassenzimmer
Commits
4927ae7f
Commit
4927ae7f
authored
5 months ago
by
Falampe
Browse files
Options
Downloads
Patches
Plain Diff
added png support for static presentations
parent
2ad1121b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Packages/vr.teachr.displays/Runtime/Scripts/PresentationController.cs
+10
-8
10 additions, 8 deletions
...teachr.displays/Runtime/Scripts/PresentationController.cs
with
10 additions
and
8 deletions
Packages/vr.teachr.displays/Runtime/Scripts/PresentationController.cs
+
10
−
8
View file @
4927ae7f
using
Codice.Client.BaseCommands.IssueTracker
;
using
System
;
using
System.IO
;
using
TeachR.ApplicationManager
;
using
TeachR.WebCommunication
;
using
UnityEngine
;
using
TeachR.StructureTree
;
using
System.Linq
;
namespace
TeachR.Displays
{
...
...
@@ -12,6 +12,9 @@ namespace TeachR.Displays
{
public
static
Presentation
Presentation
{
get
;
private
set
;
}
public
static
event
Action
OnLoad
;
private
static
readonly
string
[]
allowedFileFormats
=
{
".png"
,
".jpg"
};
private
static
string
folderPath
;
private
static
string
[]
filePath
;
[
RuntimeInitializeOnLoadMethod
]
private
static
void
Init
()
...
...
@@ -44,17 +47,16 @@ namespace TeachR.Displays
else
Debug
.
Log
(
"No slides loaded yet"
);
}
private
static
string
folderPath
;
private
static
string
[]
filePath
;
// Look into themeFolder and load jpg-pictures to posters in classroom.
// If folder does not exist or is empty, no posters will be loaded.
public
static
async
void
LoadPresentationOnThemeChange
(
string
fromFolder
)
{
Debug
.
Log
(
"ICH LEBE!"
);
folderPath
=
Path
.
Combine
(
Application
.
streamingAssetsPath
,
"Config~"
,
fromFolder
,
"presentation"
);
if
(!
Directory
.
Exists
(
folderPath
))
return
;
filePath
=
Directory
.
GetFiles
(
folderPath
,
"*.jpg"
);
// mehr dateiformate zulassen
//filePath = Directory.GetFiles(folderPath, "*.jpg");// mehr dateiformate zulassen
filePath
=
Directory
.
GetFiles
(
folderPath
,
"*.*"
,
SearchOption
.
TopDirectoryOnly
)
.
Where
(
f
=>
allowedFileFormats
.
Contains
(
Path
.
GetExtension
(
f
)))
.
ToArray
();
if
(
filePath
.
Length
>
0
)
{
Presentation
=
await
Presentation
.
FromFiles
(
filePath
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment