mirror of
https://github.com/ryzij/Cube-Tower-Defense.git
synced 2026-07-14 01:56:57 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| daac4b0b33 | |||
| 6d7ee18874 |
@@ -66,7 +66,7 @@ AnimationClip:
|
|||||||
outWeight: 0.33333334
|
outWeight: 0.33333334
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
time: 0.5
|
time: 0.5
|
||||||
value: -116.19997
|
value: -98.8
|
||||||
inSlope: 0
|
inSlope: 0
|
||||||
outSlope: 0
|
outSlope: 0
|
||||||
tangentMode: 136
|
tangentMode: 136
|
||||||
@@ -105,7 +105,7 @@ AnimationClip:
|
|||||||
outWeight: 0.33333334
|
outWeight: 0.33333334
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
time: 0.5
|
time: 0.5
|
||||||
value: 35.29999
|
value: 33.8
|
||||||
inSlope: 0
|
inSlope: 0
|
||||||
outSlope: 0
|
outSlope: 0
|
||||||
tangentMode: 136
|
tangentMode: 136
|
||||||
@@ -144,7 +144,7 @@ AnimationClip:
|
|||||||
outWeight: 0.33333334
|
outWeight: 0.33333334
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
time: 0.5
|
time: 0.5
|
||||||
value: 6.9000063
|
value: 8.4
|
||||||
inSlope: 0
|
inSlope: 0
|
||||||
outSlope: 0
|
outSlope: 0
|
||||||
tangentMode: 136
|
tangentMode: 136
|
||||||
@@ -168,6 +168,84 @@ AnimationClip:
|
|||||||
classID: 224
|
classID: 224
|
||||||
script: {fileID: 0}
|
script: {fileID: 0}
|
||||||
flags: 0
|
flags: 0
|
||||||
|
- serializedVersion: 2
|
||||||
|
curve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: -116.2
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0.5
|
||||||
|
value: -97.1
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 1
|
||||||
|
value: -116.2
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
attribute: m_AnchoredPosition.x
|
||||||
|
path:
|
||||||
|
classID: 224
|
||||||
|
script: {fileID: 0}
|
||||||
|
flags: 0
|
||||||
|
- serializedVersion: 2
|
||||||
|
curve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: 35.3
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0.5
|
||||||
|
value: 33.8
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 1
|
||||||
|
value: 35.3
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
attribute: m_AnchoredPosition.y
|
||||||
|
path:
|
||||||
|
classID: 224
|
||||||
|
script: {fileID: 0}
|
||||||
|
flags: 0
|
||||||
m_PPtrCurves: []
|
m_PPtrCurves: []
|
||||||
m_SampleRate: 60
|
m_SampleRate: 60
|
||||||
m_WrapMode: 0
|
m_WrapMode: 0
|
||||||
@@ -194,6 +272,15 @@ AnimationClip:
|
|||||||
isPPtrCurve: 0
|
isPPtrCurve: 0
|
||||||
isIntCurve: 0
|
isIntCurve: 0
|
||||||
isSerializeReferenceCurve: 0
|
isSerializeReferenceCurve: 0
|
||||||
|
- serializedVersion: 2
|
||||||
|
path: 0
|
||||||
|
attribute: 3762036201
|
||||||
|
script: {fileID: 0}
|
||||||
|
typeID: 224
|
||||||
|
customType: 0
|
||||||
|
isPPtrCurve: 0
|
||||||
|
isIntCurve: 0
|
||||||
|
isSerializeReferenceCurve: 0
|
||||||
- serializedVersion: 2
|
- serializedVersion: 2
|
||||||
path: 0
|
path: 0
|
||||||
attribute: 2033536083
|
attribute: 2033536083
|
||||||
@@ -205,10 +292,19 @@ AnimationClip:
|
|||||||
isSerializeReferenceCurve: 0
|
isSerializeReferenceCurve: 0
|
||||||
- serializedVersion: 2
|
- serializedVersion: 2
|
||||||
path: 0
|
path: 0
|
||||||
attribute: 3762036201
|
attribute: 1460864421
|
||||||
script: {fileID: 0}
|
script: {fileID: 0}
|
||||||
typeID: 224
|
typeID: 224
|
||||||
customType: 0
|
customType: 28
|
||||||
|
isPPtrCurve: 0
|
||||||
|
isIntCurve: 0
|
||||||
|
isSerializeReferenceCurve: 0
|
||||||
|
- serializedVersion: 2
|
||||||
|
path: 0
|
||||||
|
attribute: 538195251
|
||||||
|
script: {fileID: 0}
|
||||||
|
typeID: 224
|
||||||
|
customType: 28
|
||||||
isPPtrCurve: 0
|
isPPtrCurve: 0
|
||||||
isIntCurve: 0
|
isIntCurve: 0
|
||||||
isSerializeReferenceCurve: 0
|
isSerializeReferenceCurve: 0
|
||||||
@@ -366,7 +462,7 @@ AnimationClip:
|
|||||||
outWeight: 0.33333334
|
outWeight: 0.33333334
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
time: 0.5
|
time: 0.5
|
||||||
value: -116.19997
|
value: -98.8
|
||||||
inSlope: 0
|
inSlope: 0
|
||||||
outSlope: 0
|
outSlope: 0
|
||||||
tangentMode: 136
|
tangentMode: 136
|
||||||
@@ -405,7 +501,7 @@ AnimationClip:
|
|||||||
outWeight: 0.33333334
|
outWeight: 0.33333334
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
time: 0.5
|
time: 0.5
|
||||||
value: 35.29999
|
value: 33.8
|
||||||
inSlope: 0
|
inSlope: 0
|
||||||
outSlope: 0
|
outSlope: 0
|
||||||
tangentMode: 136
|
tangentMode: 136
|
||||||
@@ -444,7 +540,7 @@ AnimationClip:
|
|||||||
outWeight: 0.33333334
|
outWeight: 0.33333334
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
time: 0.5
|
time: 0.5
|
||||||
value: 6.9000063
|
value: 8.4
|
||||||
inSlope: 0
|
inSlope: 0
|
||||||
outSlope: 0
|
outSlope: 0
|
||||||
tangentMode: 136
|
tangentMode: 136
|
||||||
@@ -468,6 +564,84 @@ AnimationClip:
|
|||||||
classID: 224
|
classID: 224
|
||||||
script: {fileID: 0}
|
script: {fileID: 0}
|
||||||
flags: 0
|
flags: 0
|
||||||
|
- serializedVersion: 2
|
||||||
|
curve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: -116.2
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0.5
|
||||||
|
value: -97.1
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 1
|
||||||
|
value: -116.2
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
attribute: m_AnchoredPosition.x
|
||||||
|
path:
|
||||||
|
classID: 224
|
||||||
|
script: {fileID: 0}
|
||||||
|
flags: 0
|
||||||
|
- serializedVersion: 2
|
||||||
|
curve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: 35.3
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0.5
|
||||||
|
value: 33.8
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 1
|
||||||
|
value: 35.3
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
attribute: m_AnchoredPosition.y
|
||||||
|
path:
|
||||||
|
classID: 224
|
||||||
|
script: {fileID: 0}
|
||||||
|
flags: 0
|
||||||
m_EulerEditorCurves:
|
m_EulerEditorCurves:
|
||||||
- serializedVersion: 2
|
- serializedVersion: 2
|
||||||
curve:
|
curve:
|
||||||
|
|||||||
@@ -171,6 +171,7 @@ MonoBehaviour:
|
|||||||
_pathStart: {fileID: 1415278839}
|
_pathStart: {fileID: 1415278839}
|
||||||
_pathEnd: {fileID: 761061820}
|
_pathEnd: {fileID: 761061820}
|
||||||
_resetBlockTime: 0.03
|
_resetBlockTime: 0.03
|
||||||
|
_destroyBlockDelay: 0.5
|
||||||
_pathFinish:
|
_pathFinish:
|
||||||
- {fileID: 1987853413}
|
- {fileID: 1987853413}
|
||||||
- {fileID: 1569763699}
|
- {fileID: 1569763699}
|
||||||
|
|||||||
@@ -13,12 +13,15 @@ public class SandPathBuildService : MonoBehaviour
|
|||||||
[SerializeField] private BlockScript _pathStart;
|
[SerializeField] private BlockScript _pathStart;
|
||||||
[SerializeField] private BlockScript _pathEnd;
|
[SerializeField] private BlockScript _pathEnd;
|
||||||
[SerializeField] private float _resetBlockTime = 0.5f;
|
[SerializeField] private float _resetBlockTime = 0.5f;
|
||||||
|
[SerializeField] private float _destroyBlockDelay = 1f;
|
||||||
[SerializeField] private BlockScript[] _pathFinish;
|
[SerializeField] private BlockScript[] _pathFinish;
|
||||||
[SerializeField] private BlockScript[] _predefinedBlocks;
|
[SerializeField] private BlockScript[] _predefinedBlocks;
|
||||||
|
|
||||||
[SerializeField] private UnityEvent<BlockScript> _onBlockDestroy;
|
[SerializeField] private UnityEvent<BlockScript> _onBlockDestroy;
|
||||||
[SerializeField] private UnityEvent _onBuildComplete;
|
[SerializeField] private UnityEvent _onBuildComplete;
|
||||||
|
|
||||||
|
private float _spawnBlockTime;
|
||||||
|
|
||||||
public event UnityAction<BlockScript> OnBlockDestroy
|
public event UnityAction<BlockScript> OnBlockDestroy
|
||||||
{
|
{
|
||||||
add => _onBlockDestroy.AddListener(value);
|
add => _onBlockDestroy.AddListener(value);
|
||||||
@@ -95,7 +98,8 @@ public class SandPathBuildService : MonoBehaviour
|
|||||||
return;
|
return;
|
||||||
if (block == _currentBlock)
|
if (block == _currentBlock)
|
||||||
{
|
{
|
||||||
ResetLastBlock();
|
if (Time.time - _spawnBlockTime >= _destroyBlockDelay)
|
||||||
|
ResetLastBlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!block.CompareTag("GrassBlock") ||
|
if (!block.CompareTag("GrassBlock") ||
|
||||||
@@ -106,6 +110,7 @@ public class SandPathBuildService : MonoBehaviour
|
|||||||
var t = block.transform;
|
var t = block.transform;
|
||||||
_currentBlock = Instantiate(_blockPrefab, t.position, t.localRotation, t.parent);
|
_currentBlock = Instantiate(_blockPrefab, t.position, t.localRotation, t.parent);
|
||||||
_blocksInPath.Add(_currentBlock);
|
_blocksInPath.Add(_currentBlock);
|
||||||
|
_spawnBlockTime = Time.time;
|
||||||
if (_pathFinish.Contains(block))
|
if (_pathFinish.Contains(block))
|
||||||
{
|
{
|
||||||
_currentBlock = _pathEnd;
|
_currentBlock = _pathEnd;
|
||||||
|
|||||||
Reference in New Issue
Block a user