Skip to content

Commit 679f070

Browse files
committed
add: plugin dotween
1 parent f05265d commit 679f070

File tree

1,522 files changed

+318867
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,522 files changed

+318867
-5
lines changed

Assets/Code/Infrastructure/GameInstaller.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
using System;
22
using Code.Infrastructure.Services.GameStater;
3+
using UnityEngine;
34
using Zenject;
45

56
namespace CodeBase.Infrastructure
67
{
78
public class GameInstaller : MonoInstaller, IInitializable, IDisposable
89
{
10+
[SerializeField] private GameObject _mapHolder;
11+
912
public override void InstallBindings()
1013
{
1114
Container.BindInterfacesTo<GameInstaller>().FromInstance(this).AsSingle();

Assets/Code/Infrastructure/Services/Generator.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Code/Infrastructure/Tiles.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
using UnityEngine;
2+
using DG.Tweening;
3+
4+
namespace Code
5+
{
6+
public class Tile : MonoBehaviour
7+
{
8+
[Header("Refs")]
9+
[SerializeField] private Material _tileMaterial;
10+
[SerializeField] private GameObject _tile;
11+
[SerializeField] private GameObject _positionSetUpBlock;
12+
13+
private GameObject _block;
14+
15+
private Tween _tileTween;
16+
private Tween _blockTween;
17+
18+
public void SetColor(Color color)
19+
{
20+
_tileMaterial.color = color;
21+
}
22+
23+
public void SetBlock(GameObject block)
24+
{
25+
_block = block;
26+
_block.transform.position = _positionSetUpBlock.transform.position;
27+
_block.transform.SetParent(this.transform);
28+
_block.transform.localScale = Vector3.zero; // чтобы при показе красиво появилось
29+
30+
PlayAnimationShowBlock();
31+
}
32+
33+
public void PlayAnimationShowTile()
34+
{
35+
_tile.transform.localScale = Vector3.zero;
36+
_tileTween?.Kill();
37+
38+
_tileTween = _tile.transform.DOScale(Vector3.one, 0.25f)
39+
.SetEase(Ease.OutBack);
40+
}
41+
42+
public void PlayAnimationHideTile()
43+
{
44+
_tileTween?.Kill();
45+
46+
_tileTween = _tile.transform.DOScale(Vector3.zero, 0.2f)
47+
.SetEase(Ease.InBack);
48+
}
49+
50+
public void PlayAnimationShowBlock()
51+
{
52+
if (_block == null) return;
53+
54+
_block.transform.localScale = Vector3.zero;
55+
_blockTween?.Kill();
56+
57+
_blockTween = _block.transform.DOScale(Vector3.one, 0.25f)
58+
.SetEase(Ease.OutBack)
59+
.OnComplete(() =>
60+
{
61+
// лёгкая вибрация после появления
62+
_block.transform.DOPunchScale(Vector3.one * 0.1f, 0.2f, 8, 0.5f);
63+
});
64+
}
65+
66+
public void PlayAnimationHideBlock()
67+
{
68+
if (_block == null) return;
69+
70+
_blockTween?.Kill();
71+
72+
_blockTween = _block.transform.DOScale(Vector3.zero, 0.2f)
73+
.SetEase(Ease.InBack)
74+
.OnComplete(() =>
75+
{
76+
Destroy(_block);
77+
_block = null;
78+
});
79+
}
80+
}
81+
}

Assets/Code/Infrastructure/Tiles/Tile.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Plugins/Demigiant.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Plugins/Demigiant/DOTween.meta

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)