Commit 46410cc4 authored by 16이진형's avatar 16이진형

auto move double click

parent 6ffdbed0
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DoubleClick : MonoBehaviour
{
private bool click = true; //클릭 여부
private float clickWaitTime = 0.5f; //클릭 대기시간
private float clickTime;
public UIManager uiManager;
public
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Time.time > clickTime + clickWaitTime)
{
click = false;
}
}
public void OnClick()
{
if (click)
{
OnDoubleClick();
click = false;
}
else
{
//Debug.Log("single");
click = true;
clickTime = Time.time;
}
}
private void OnDoubleClick()
{
uiManager.OnDoubleClicked();
}
}
fileFormatVersion: 2
guid: 93204f29ac386764180b8a4c079542ff
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
...@@ -138,9 +138,10 @@ public class FlatlandMovement : MonoBehaviour ...@@ -138,9 +138,10 @@ public class FlatlandMovement : MonoBehaviour
/// 목적지로 바로 이동합니다. /// 목적지로 바로 이동합니다.
/// </summary> /// </summary>
/// <param name="path">목적지 x z 가 공간</param> /// <param name="path">목적지 x z 가 공간</param>
/// <param name="v">속력</param> /// <param name="v">속력 0<v<1</param>
private bool MoveTo(Vector3 dest, float v) public bool MoveTo(Vector3 dest, float v)
{ {
dest.y = 0;
Debug.Log("bb"); Debug.Log("bb");
Debug.Log(dest); Debug.Log(dest);
if (v < 0.0001f) if (v < 0.0001f)
......
...@@ -222,4 +222,30 @@ public class UIManager : MonoBehaviour ...@@ -222,4 +222,30 @@ public class UIManager : MonoBehaviour
} }
} }
public void OnDoubleClicked()
{
try
{
if (levelManager.player.isInertial())
{
RaycastHit hit;
var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray, out hit))
{
ray = playercamera.ViewportPointToRay(hit.textureCoord);
if (Physics.Raycast(ray, out hit))
{
levelManager.player.MoveTo(hit.point, velocityslider.GetLogScaleValue());
//Debug.Log(velocityslider.GetLogScaleValue() * (float)Constants.c);
//Debug.Log(hit.point);
}
}
}
}
catch(Exception e)
{
Debug.Log(e);
}
}
} }
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
--- !u!129 &1 --- !u!129 &1
PlayerSettings: PlayerSettings:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
serializedVersion: 16 serializedVersion: 18
productGUID: b7f5cb2eae1198541a966c1c48e71736 productGUID: b7f5cb2eae1198541a966c1c48e71736
AndroidProfiler: 0 AndroidProfiler: 0
AndroidFilterTouchesWhenObscured: 0 AndroidFilterTouchesWhenObscured: 0
...@@ -52,8 +52,8 @@ PlayerSettings: ...@@ -52,8 +52,8 @@ PlayerSettings:
m_StackTraceTypes: 010000000100000001000000010000000100000001000000 m_StackTraceTypes: 010000000100000001000000010000000100000001000000
iosShowActivityIndicatorOnLoading: -1 iosShowActivityIndicatorOnLoading: -1
androidShowActivityIndicatorOnLoading: -1 androidShowActivityIndicatorOnLoading: -1
iosAppInBackgroundBehavior: 0
displayResolutionDialog: 0 displayResolutionDialog: 0
iosUseCustomAppBackgroundBehavior: 0
iosAllowHTTPDownload: 1 iosAllowHTTPDownload: 1
allowedAutorotateToPortrait: 1 allowedAutorotateToPortrait: 1
allowedAutorotateToPortraitUpsideDown: 1 allowedAutorotateToPortraitUpsideDown: 1
...@@ -65,6 +65,7 @@ PlayerSettings: ...@@ -65,6 +65,7 @@ PlayerSettings:
disableDepthAndStencilBuffers: 0 disableDepthAndStencilBuffers: 0
androidStartInFullscreen: 1 androidStartInFullscreen: 1
androidRenderOutsideSafeArea: 1 androidRenderOutsideSafeArea: 1
androidUseSwappy: 0
androidBlitType: 0 androidBlitType: 0
defaultIsNativeResolution: 1 defaultIsNativeResolution: 1
macRetinaSupport: 1 macRetinaSupport: 1
...@@ -149,6 +150,7 @@ PlayerSettings: ...@@ -149,6 +150,7 @@ PlayerSettings:
oculus: oculus:
sharedDepthBuffer: 1 sharedDepthBuffer: 1
dashSupport: 1 dashSupport: 1
lowOverheadMode: 0
enable360StereoCapture: 0 enable360StereoCapture: 0
isWsaHolographicRemotingEnabled: 0 isWsaHolographicRemotingEnabled: 0
protectGraphicsMemory: 0 protectGraphicsMemory: 0
...@@ -269,6 +271,8 @@ PlayerSettings: ...@@ -269,6 +271,8 @@ PlayerSettings:
height: 180 height: 180
banner: {fileID: 0} banner: {fileID: 0}
androidGamepadSupportLevel: 0 androidGamepadSupportLevel: 0
AndroidValidateAppBundleSize: 1
AndroidAppBundleSizeToValidate: 150
resolutionDialogBanner: {fileID: 0} resolutionDialogBanner: {fileID: 0}
m_BuildTargetIcons: [] m_BuildTargetIcons: []
m_BuildTargetPlatformIcons: [] m_BuildTargetPlatformIcons: []
...@@ -278,10 +282,10 @@ PlayerSettings: ...@@ -278,10 +282,10 @@ PlayerSettings:
m_APIs: 150000000b000000 m_APIs: 150000000b000000
m_Automatic: 0 m_Automatic: 0
m_BuildTargetVRSettings: [] m_BuildTargetVRSettings: []
m_BuildTargetEnableVuforiaSettings: []
openGLRequireES31: 0 openGLRequireES31: 0
openGLRequireES31AEP: 0 openGLRequireES31AEP: 0
openGLRequireES32: 0 openGLRequireES32: 0
vuforiaEnabled: 0
m_TemplateCustomTags: {} m_TemplateCustomTags: {}
mobileMTRendering: mobileMTRendering:
Android: 1 Android: 1
...@@ -499,6 +503,7 @@ PlayerSettings: ...@@ -499,6 +503,7 @@ PlayerSettings:
monoEnv: monoEnv:
splashScreenBackgroundSourceLandscape: {fileID: 0} splashScreenBackgroundSourceLandscape: {fileID: 0}
splashScreenBackgroundSourcePortrait: {fileID: 0} splashScreenBackgroundSourcePortrait: {fileID: 0}
blurSplashScreenBackground: 1
spritePackerPolicy: spritePackerPolicy:
webGLMemorySize: 16 webGLMemorySize: 16
webGLExceptionSupport: 1 webGLExceptionSupport: 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment