Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xr-project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
William G. Tresselt
xr-project
Commits
6846c8fd
Commit
6846c8fd
authored
2 years ago
by
William G. Tresselt
Browse files
Options
Downloads
Patches
Plain Diff
Fixed more bugs related to colors and made it more apparent which is activated
parent
42a8a004
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ChromeEnigma/Assets/ColorSubscriber.cs
+7
-2
7 additions, 2 deletions
ChromeEnigma/Assets/ColorSubscriber.cs
ChromeEnigma/Assets/Scripts/ColorChanger.cs
+5
-2
5 additions, 2 deletions
ChromeEnigma/Assets/Scripts/ColorChanger.cs
with
12 additions
and
4 deletions
ChromeEnigma/Assets/ColorSubscriber.cs
+
7
−
2
View file @
6846c8fd
...
...
@@ -23,11 +23,16 @@ public class ColorSubscriber : MonoBehaviour
public
void
notifyColorChange
(
Color
c
)
{
if
(
c
==
material
.
color
)
if
(
c
.
r
==
material
.
color
.
r
&&
c
.
g
==
material
.
color
.
g
&&
c
.
b
==
material
.
color
.
b
)
{
Debug
.
Log
(
"Subscriber got notified: "
+
c
);
mCollider
.
enabled
=
true
;
material
.
color
=
new
Color
(
c
.
r
,
c
.
g
,
c
.
b
);
}
else
{
mCollider
.
enabled
=
false
;
material
.
color
=
new
Color
(
material
.
color
.
r
,
material
.
color
.
g
,
material
.
color
.
b
,
0.1f
);
}
else
mCollider
.
enabled
=
false
;
}
}
This diff is collapsed.
Click to expand it.
ChromeEnigma/Assets/Scripts/ColorChanger.cs
+
5
−
2
View file @
6846c8fd
...
...
@@ -18,6 +18,10 @@ public class ColorChanger : MonoBehaviour
material
=
userrenderer
.
material
;
if
(
groundColored
==
null
)
groundColored
=
GameObject
.
FindGameObjectsWithTag
(
"GroundColored"
);
foreach
(
GameObject
g
in
groundColored
)
{
if
(
g
!=
null
)
g
.
GetComponent
<
ColorSubscriber
>().
notifyColorChange
(
material
.
color
);
}
}
// Update is called once per frame
...
...
@@ -28,8 +32,7 @@ public class ColorChanger : MonoBehaviour
material
.
color
=
Color
.
red
;
foreach
(
GameObject
g
in
groundColored
)
{
if
(
g
!=
null
)
g
.
GetComponent
<
ColorSubscriber
>().
notifyColorChange
(
Color
.
red
);
}
if
(
g
!=
null
)
g
.
GetComponent
<
ColorSubscriber
>().
notifyColorChange
(
Color
.
red
);
}
}
if
(
Input
.
GetButtonDown
(
KeyCode
.
Alpha2
.
ToString
()))
{
...
...
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