Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design1
/
LSK_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
고다경
2020-06-10 02:10:08 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4711abc1cd44ea65df70425a3182408063f73103
4711abc1
1 parent
9c12766f
intro scene: clicking with quad completed
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
89 additions
and
5 deletions
l
sourcecode/capstone/Assets/Scenes/Intro.unity
sourcecode/capstone/Assets/Scenes/Start.unity
sourcecode/capstone/Assets/Script/ClickExercise.cs
sourcecode/capstone/Assets/Script/Title.cs
l
0 → 100644
View file @
4711abc
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
http.sslbackend=openssl
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
core.autocrlf=true
core.fscache=true
core.symlinks=false
credential.helper=manager
add.interactive.usebuiltin=true
pull.rebase=false
user.name=Dakyung Go
user.email=ludkg@khu.ac.kr
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
remote.origin.url=http://khuhub.khu.ac.kr/2020-1-capstone-design1/LSK_Project1.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
sourcecode/capstone/Assets/Scenes/Intro.unity
View file @
4711abc
...
...
@@ -406,7 +406,7 @@ RectTransform:
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0.5
,
y
:
0.5
}
m_AnchorMax
:
{
x
:
0.5
,
y
:
0.5
}
m_AnchoredPosition
:
{
x
:
1
30
,
y
:
10
}
m_AnchoredPosition
:
{
x
:
1
95
,
y
:
10
}
m_SizeDelta
:
{
x
:
100
,
y
:
100
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!114
&485542717
...
...
sourcecode/capstone/Assets/Scenes/Start.unity
View file @
4711abc
...
...
@@ -494,7 +494,7 @@ GameObject:
-
component
:
{
fileID
:
838204468
}
-
component
:
{
fileID
:
838204467
}
m_Layer
:
0
m_Name
:
'
Quad
'
m_Name
:
Quad_s
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
...
...
@@ -561,7 +561,7 @@ MonoBehaviour:
m_Script
:
{
fileID
:
11500000
,
guid
:
4381b5042657b804ba0695ce7a8c7128
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
BodySrcManager
:
{
fileID
:
0
}
BodySrcManager
:
{
fileID
:
18361255
0
}
TrackedJoint
:
11
multiplier
:
200
---
!u!64
&838204471
...
...
@@ -641,7 +641,7 @@ RectTransform:
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0.5
,
y
:
0.5
}
m_AnchorMax
:
{
x
:
0.5
,
y
:
0.5
}
m_AnchoredPosition
:
{
x
:
1
30
,
y
:
0
}
m_AnchoredPosition
:
{
x
:
1
55
,
y
:
0
}
m_SizeDelta
:
{
x
:
100
,
y
:
100
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!1
&915514423
...
...
sourcecode/capstone/Assets/Script/ClickExercise.cs
View file @
4711abc
...
...
@@ -10,13 +10,23 @@ public class ClickExercise : MonoBehaviour
RawImage
btnImage2
;
GameObject
btnParent
;
//버튼들의 부모
GameObject
quad
;
//커서
Vector3
pos
;
private
float
timer
;
private
void
Start
()
{
btnParent
=
GameObject
.
Find
(
"BtnGroup"
).
gameObject
;
// "부모의 이름"으로 찾습니다.
quad
=
GameObject
.
Find
(
"Quad_s"
).
gameObject
;
pos
=
quad
.
transform
.
position
;
Debug
.
Log
(
pos
);
}
public
void
GetBtn
()
{
Debug
.
Log
(
"GetBtn"
);
GameObject
tempBtn
=
EventSystem
.
current
.
currentSelectedGameObject
;
btnImage
=
tempBtn
.
GetComponent
<
RawImage
>();
// 해당 오브젝트의 image 컴포넌트를 받음
...
...
@@ -52,7 +62,27 @@ public class ClickExercise : MonoBehaviour
}
else
if
(
btnImage
.
name
==
"SideHiKick"
)
{
Debug
.
Log
(
"SideHighKick"
);
btnImage
.
texture
=
Resources
.
Load
(
"SideHiKick_on"
,
typeof
(
Texture2D
))
as
Texture2D
;
}
}
void
Update
()
{
pos
=
quad
.
transform
.
position
;
Debug
.
Log
(
pos
);
/*
if (pos.x >= 155 && pos.x <= 185 && pos.y >= 13 && pos.y <= 60) {
btnImage2.texture = Resources.Load("Squat_off", typeof(Texture2D)) as Texture2D;
btnImage.texture = Resources.Load("SideHiKick_on", typeof(Texture2D)) as Texture2D;
btnImage2.texture = Resources.Load("Lunge_off", typeof(Texture2D)) as Texture2D;
}
*/
}
}
...
...
sourcecode/capstone/Assets/Script/Title.cs
View file @
4711abc
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine.UI
;
using
UnityEngine.EventSystems
;
using
UnityEngine.SceneManagement
;
public
class
Title
:
MonoBehaviour
{
public
string
SceneToLoad
;
GameObject
quad
;
//커서
Vector3
pos
;
private
float
timer
;
private
void
Start
()
{
Debug
.
Log
(
"Start"
);
quad
=
GameObject
.
Find
(
"Quad"
).
gameObject
;
}
public
void
LoadGame
()
{
SceneManager
.
LoadScene
(
SceneToLoad
);
}
void
u
pdate
()
void
U
pdate
()
{
Debug
.
Log
(
"Update"
);
pos
=
quad
.
transform
.
position
;
Debug
.
Log
(
pos
);
if
(
pos
.
x
>=
145
&&
pos
.
x
<=
195
&&
pos
.
y
>=
-
18
&&
pos
.
y
<=
-
10
)
{
timer
+=
Time
.
deltaTime
;
Debug
.
Log
(
"Timer: "
+
timer
);
if
(
timer
>
2
)
{
Debug
.
Log
(
"Clicked"
);
SceneManager
.
LoadScene
(
SceneToLoad
);
}
}
Debug
.
Log
(
"1"
);
if
(
Input
.
GetMouseButtonDown
(
0
))
{
...
...
Please
register
or
login
to post a comment