고다경

intro scene: clicking with quad completed

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
......@@ -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: 130, y: 10}
m_AnchoredPosition: {x: 195, y: 10}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &485542717
......
......@@ -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: 183612550}
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: 130, y: 0}
m_AnchoredPosition: {x: 155, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &915514423
......
......@@ -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;
}
*/
}
}
......
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 update()
void Update()
{
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))
{
......