#13 Assault Mode Test
This commit is contained in:
parent
68b2e11b1a
commit
749d3dc633
File diff suppressed because it is too large
Load Diff
62
BlueWater/Assets/02.Scripts/DraggableCard.cs
Normal file
62
BlueWater/Assets/02.Scripts/DraggableCard.cs
Normal file
@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
public class DraggableCard : MonoBehaviour, IPointerDownHandler, IDragHandler, IPointerUpHandler
|
||||
{
|
||||
private Vector3 originalPosition;
|
||||
private CanvasGroup canvasGroup;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
canvasGroup = GetComponent<CanvasGroup>();
|
||||
}
|
||||
|
||||
public void OnPointerDown(PointerEventData eventData)
|
||||
{
|
||||
originalPosition = transform.position;
|
||||
canvasGroup.alpha = 0.5f;
|
||||
}
|
||||
|
||||
public void OnDrag(PointerEventData eventData)
|
||||
{
|
||||
transform.position = Input.mousePosition;
|
||||
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
||||
RaycastHit hit;
|
||||
if (Physics.Raycast(ray, out hit) && hit.collider.tag == "Ground") // Ground 태그로 변경하였습니다.
|
||||
{
|
||||
canvasGroup.alpha = 0; // 마우스가 Ground 위에 있을 때 투명도 변경
|
||||
}
|
||||
else
|
||||
{
|
||||
canvasGroup.alpha = 0.5f;
|
||||
}
|
||||
}
|
||||
|
||||
public void OnPointerUp(PointerEventData eventData)
|
||||
{
|
||||
canvasGroup.alpha = 1;
|
||||
|
||||
// 지형에 올바르게 드롭되지 않으면 원래 위치로 되돌림
|
||||
if (!IsDroppedOnTarget())
|
||||
{
|
||||
transform.position = originalPosition;
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsDroppedOnTarget()
|
||||
{
|
||||
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
||||
RaycastHit hit;
|
||||
|
||||
if (Physics.Raycast(ray, out hit))
|
||||
{
|
||||
if (hit.collider.tag == "Ground")
|
||||
{
|
||||
Destroy(gameObject);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
11
BlueWater/Assets/02.Scripts/DraggableCard.cs.meta
Normal file
11
BlueWater/Assets/02.Scripts/DraggableCard.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d3be018f5bcd344d2abd41e15265e325
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -5,10 +5,12 @@ using UnityEngine;
|
||||
public class GameManager : Singleton<GameManager>
|
||||
{
|
||||
public CameraController CameraController { get; private set; }
|
||||
public UiController UiController { get; private set; }
|
||||
|
||||
private void Init()
|
||||
{
|
||||
CameraController = FindObjectOfType<CameraController>();
|
||||
UiController = FindObjectOfType<UiController>();
|
||||
}
|
||||
protected override void OnAwake()
|
||||
{
|
||||
|
11
BlueWater/Assets/02.Scripts/UiController.cs
Normal file
11
BlueWater/Assets/02.Scripts/UiController.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Doozy.Runtime.Reactor.Animations;
|
||||
using Doozy.Runtime.Reactor.Animators;
|
||||
using UnityEngine;
|
||||
|
||||
public class UiController : MonoBehaviour
|
||||
{
|
||||
public UIAnimator uiAnimator;
|
||||
}
|
11
BlueWater/Assets/02.Scripts/UiController.cs.meta
Normal file
11
BlueWater/Assets/02.Scripts/UiController.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 06c19c0e062e84c169aca3af92060883
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -42,12 +42,14 @@ namespace _02.Scripts.WaterAndShip
|
||||
private void SwitchToDredgeMode()
|
||||
{
|
||||
GameManager.Inst.CameraController.CamDredgeMode();
|
||||
GameManager.Inst.UiController.uiAnimator.Reverse();
|
||||
isAssaultMode = false;
|
||||
}
|
||||
|
||||
private void SwitchToAssaultMode()
|
||||
{
|
||||
GameManager.Inst.CameraController.CamAssaultMode();
|
||||
GameManager.Inst.UiController.uiAnimator.Play();
|
||||
isAssaultMode = true;
|
||||
}
|
||||
|
||||
|
@ -28,9 +28,9 @@ RectTransform:
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 3690243428023043520}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
@ -104,10 +104,10 @@ RectTransform:
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 4569038876771775079}
|
||||
m_Father: {fileID: 3690243428023043520}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
@ -192,9 +192,9 @@ RectTransform:
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 3690243428065942295}
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
@ -248,11 +248,11 @@ RectTransform:
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 8535611951113785140}
|
||||
- {fileID: 4333603477576732178}
|
||||
m_Father: {fileID: 3690243428065942295}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
@ -306,6 +306,7 @@ RectTransform:
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 3690243428179819046}
|
||||
- {fileID: 3690243428023043520}
|
||||
@ -314,7 +315,6 @@ RectTransform:
|
||||
- {fileID: 3690243427811257226}
|
||||
- {fileID: 3690243429172494780}
|
||||
m_Father: {fileID: 3690243429157186517}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
@ -374,9 +374,9 @@ RectTransform:
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 3690243428065942295}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
@ -434,10 +434,10 @@ RectTransform:
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 3690243428065942295}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
@ -461,7 +461,9 @@ Canvas:
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_VertexColorAlwaysGammaSpace: 0
|
||||
m_AdditionalShaderChannelsFlag: 25
|
||||
m_UpdateRectTransformForStandalone: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_TargetDisplay: 0
|
||||
@ -493,7 +495,7 @@ MonoBehaviour:
|
||||
m_BlockingObjects: 0
|
||||
m_BlockingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_Bits: 7999
|
||||
--- !u!114 &3690243429157186519
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -509,28 +511,24 @@ MonoBehaviour:
|
||||
MultiplayerInfo: {fileID: 0}
|
||||
OnStartBehaviour: 1
|
||||
OnShowCallback:
|
||||
Enabled: 0
|
||||
EventName: OnShowCallback
|
||||
Runners: []
|
||||
Event:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
OnVisibleCallback:
|
||||
Enabled: 0
|
||||
EventName: OnVisibleCallback
|
||||
Runners: []
|
||||
Event:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
OnHideCallback:
|
||||
Enabled: 0
|
||||
EventName: OnHideCallback
|
||||
Runners: []
|
||||
Event:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
OnHiddenCallback:
|
||||
Enabled: 0
|
||||
EventName: OnHiddenCallback
|
||||
Runners: []
|
||||
Event:
|
||||
@ -539,6 +537,9 @@ MonoBehaviour:
|
||||
OnVisibilityChangedCallback:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
ShowProgressors: []
|
||||
HideProgressors: []
|
||||
ShowHideProgressors: []
|
||||
CustomStartPosition: {x: 0, y: 160, z: 0}
|
||||
UseCustomStartPosition: 1
|
||||
AutoHideAfterShow: 0
|
||||
@ -546,14 +547,16 @@ MonoBehaviour:
|
||||
DisableGameObjectWhenHidden: 0
|
||||
DisableCanvasWhenHidden: 1
|
||||
DisableGraphicRaycasterWhenHidden: 1
|
||||
HandleCanvasGroupBlockRaycasts: 1
|
||||
ClearSelectedOnShow: 0
|
||||
ClearSelectedOnHide: 0
|
||||
AutoSelectAfterShow: 0
|
||||
AutoSelectTarget: {fileID: 0}
|
||||
Id:
|
||||
Category: View
|
||||
Name: Main
|
||||
Custom: 1
|
||||
ClearSelectedOnHide: 0
|
||||
ClearSelectedOnShow: 0
|
||||
AutoSelectAfterShow: 0
|
||||
AutoSelectTarget: {fileID: 0}
|
||||
TargetOrientation: 0
|
||||
--- !u!114 &3690243429157186516
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -1137,14 +1140,14 @@ RectTransform:
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 3690243428065942295}
|
||||
m_RootOrder: 5
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 540.32117, y: 0}
|
||||
m_SizeDelta: {x: 952.64233, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &3690243429172494776
|
||||
CanvasRenderer:
|
||||
@ -1311,14 +1314,14 @@ RectTransform:
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 3690243428065942295}
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 540.32117, y: 0}
|
||||
m_SizeDelta: {x: 159.54, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &3690243429213982652
|
||||
CanvasRenderer:
|
||||
@ -1479,9 +1482,9 @@ RectTransform:
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 3690243428065942295}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
@ -1536,9 +1539,9 @@ RectTransform:
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 8535611951113785140}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
|
@ -3,7 +3,9 @@
|
||||
--- !u!78 &1
|
||||
TagManager:
|
||||
serializedVersion: 2
|
||||
tags: []
|
||||
tags:
|
||||
- Ship
|
||||
- Ground
|
||||
layers:
|
||||
- Default
|
||||
- TransparentFX
|
||||
|
Loading…
Reference in New Issue
Block a user