Merge branch 'Zakhar' of https://github.com/BG-Games/S_Jump-and-grub into Zakhar
This commit is contained in:
commit
831b007331
@ -32,7 +32,7 @@ RectTransform:
|
||||
m_Children:
|
||||
- {fileID: 3205969477031557256}
|
||||
m_Father: {fileID: 7535381195931813741}
|
||||
m_RootOrder: 0
|
||||
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}
|
||||
@ -151,7 +151,7 @@ RectTransform:
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7535381195931813741}
|
||||
m_RootOrder: 3
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
@ -316,7 +316,7 @@ Canvas:
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_AdditionalShaderChannelsFlag: 0
|
||||
m_AdditionalShaderChannelsFlag: 25
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 1
|
||||
m_TargetDisplay: 0
|
||||
@ -409,7 +409,7 @@ RectTransform:
|
||||
m_Children:
|
||||
- {fileID: 3258995203638363845}
|
||||
m_Father: {fileID: 7535381195931813741}
|
||||
m_RootOrder: 1
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
@ -530,7 +530,7 @@ RectTransform:
|
||||
m_Children:
|
||||
- {fileID: 216367779017151113}
|
||||
m_Father: {fileID: 7535381195931813741}
|
||||
m_RootOrder: 2
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
@ -1011,6 +1011,81 @@ MonoBehaviour:
|
||||
m_hasFontAssetChanged: 0
|
||||
m_baseMaterial: {fileID: 0}
|
||||
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||
--- !u!1 &5443873379656075396
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5855551985023584753}
|
||||
- component: {fileID: 3505714345849204007}
|
||||
- component: {fileID: 6130419704230661871}
|
||||
m_Layer: 5
|
||||
m_Name: Back
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &5855551985023584753
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5443873379656075396}
|
||||
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_Children: []
|
||||
m_Father: {fileID: 7535381195931813741}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 1670}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &3505714345849204007
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5443873379656075396}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &6130419704230661871
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5443873379656075396}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0, g: 0, b: 0, a: 0.14117648}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1 &6038652171774885714
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -1040,6 +1115,7 @@ RectTransform:
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 5855551985023584753}
|
||||
- {fileID: 5093098141183363274}
|
||||
- {fileID: 5296751824509684347}
|
||||
- {fileID: 5296751824694007057}
|
||||
|
@ -52,11 +52,12 @@ namespace Controller
|
||||
|
||||
hexGrid.OnGridLoaded += unitFactory.Spawn;
|
||||
|
||||
var paintedControler = new PaintedController();
|
||||
var paintedController = new PaintedController();
|
||||
|
||||
hexGrid.OnHexPainted += paintedController.SetHexColors;
|
||||
|
||||
hexGrid.OnHexPainted += paintedControler.SetHexColors;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -100,14 +100,16 @@ namespace HexFiled
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#if UNITY_EDITOR
|
||||
TMP_Text label = Object.Instantiate(_cellLabelPrefab, _gridCanvas.transform, false);
|
||||
label.rectTransform.anchoredPosition =
|
||||
new Vector2(position.x, position.z);
|
||||
label.text = cell.coordinates.ToStringOnSeparateLines();
|
||||
TMP_Text label = Object.Instantiate(_cellLabelPrefab, _gridCanvas.transform, false);
|
||||
label.rectTransform.anchoredPosition =
|
||||
new Vector2(position.x, position.z);
|
||||
label.text = cell.coordinates.ToStringOnSeparateLines();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void Init()
|
||||
{
|
||||
|
@ -6,10 +6,15 @@ namespace HexFiled
|
||||
|
||||
public class PaintedController
|
||||
{
|
||||
public static Dictionary<UnitColor, HexCell> unitCurrentCell = new Dictionary<UnitColor, HexCell>();
|
||||
public static Dictionary<UnitColor, HexCell> unitCurrentCell;
|
||||
|
||||
private HexCell _cell;
|
||||
|
||||
public PaintedController()
|
||||
{
|
||||
unitCurrentCell = new Dictionary<UnitColor, HexCell>();
|
||||
}
|
||||
|
||||
public void SetHexColors(HexCell cell)
|
||||
{
|
||||
_cell = cell;
|
||||
|
@ -22,13 +22,20 @@ public class MusicController
|
||||
_data = data;
|
||||
}
|
||||
|
||||
public void PlayerAudioClip(AudioClip clip, GameObject source)
|
||||
public void PlayAudioClip(AudioClip clip, GameObject source)
|
||||
{
|
||||
_sources[source].clip = clip;
|
||||
_sources[source].volume = _data.Settings.isSFXAllowed ? 1f : 0f;
|
||||
_sources[source].Play();
|
||||
}
|
||||
|
||||
public void PlayRandomClip(List<AudioClip> clips, GameObject source)
|
||||
{
|
||||
_sources[source].clip = clips[Random.Range(0, clips.Count - 1)];
|
||||
_sources[source].volume = _data.Settings.isSFXAllowed ? 1f : 0f;
|
||||
_sources[source].Play();
|
||||
}
|
||||
|
||||
public void AddAudioListener(GameObject gameObject)
|
||||
{
|
||||
_audioListener = gameObject.AddComponent<AudioListener>();
|
||||
|
@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using Chars;
|
||||
using Data;
|
||||
using DefaultNamespace;
|
||||
using DG.Tweening;
|
||||
using HexFiled;
|
||||
using UnityEngine;
|
||||
@ -119,19 +118,7 @@ namespace Units
|
||||
_cell.PaintHex(_data.color);
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
var neighbour = _cell.GetNeighbor((HexDirection)i);
|
||||
neighbour?.PaintHex(_data.color);
|
||||
|
||||
for (int j = 0; j < 6; j++)
|
||||
{
|
||||
var neighbour1 = neighbour?.GetNeighbor((HexDirection)j);
|
||||
neighbour1?.PaintHex(_data.color);
|
||||
|
||||
|
||||
//.PaintHex(_data.color);
|
||||
}
|
||||
|
||||
//.PaintHex(_data.color);
|
||||
_cell.GetNeighbor((HexDirection)i)?.PaintHex(_data.color);
|
||||
}
|
||||
|
||||
//
|
||||
@ -175,12 +162,12 @@ namespace Units
|
||||
}
|
||||
else
|
||||
{
|
||||
var capturesMusic = MusicController.Instance.MusicData.SfxMusic.Captures;
|
||||
MusicController.Instance.PlayerAudioClip(capturesMusic[Random.Range(0, capturesMusic.Count - 1)],
|
||||
_cell.gameObject);
|
||||
|
||||
CaptureHex();
|
||||
MusicController.Instance.PlayRandomClip(MusicController.Instance.MusicData.SfxMusic.Captures,
|
||||
_cell.gameObject);
|
||||
}
|
||||
|
||||
|
||||
_isHardToCapture = false;
|
||||
}
|
||||
|
||||
@ -202,7 +189,7 @@ namespace Units
|
||||
_instance.transform.forward + _instance.transform.position + new Vector3(0, 2),
|
||||
_instance.transform.rotation);
|
||||
MusicController.Instance.AddAudioSource(ball);
|
||||
MusicController.Instance.PlayerAudioClip(_weapon.shotSound, ball);
|
||||
MusicController.Instance.PlayAudioClip(_weapon.shotSound, ball);
|
||||
ball.AddComponent<WeaponView>().SetWeapon(_weapon);
|
||||
ball.transform.DOMove(
|
||||
new Vector3(_direction.normalized.x,
|
||||
@ -244,7 +231,7 @@ namespace Units
|
||||
_unitView.OnHit -= Damage;
|
||||
_isAlive = false;
|
||||
_animator.SetTrigger("Death");
|
||||
MusicController.Instance.PlayerAudioClip(MusicController.Instance.MusicData.SfxMusic.Death, _instance);
|
||||
MusicController.Instance.PlayAudioClip(MusicController.Instance.MusicData.SfxMusic.Death, _instance);
|
||||
MusicController.Instance.RemoveAudioSource(_instance);
|
||||
}
|
||||
|
||||
@ -280,7 +267,6 @@ namespace Units
|
||||
{
|
||||
Death();
|
||||
}
|
||||
|
||||
_hp -= dmg;
|
||||
UpdateBarCanvas();
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ public class UnitView : MonoBehaviour
|
||||
_capureHex.Invoke();
|
||||
captureBar.DOFillAmount(0f, 0f).SetEase(Ease.Linear);
|
||||
captureBar.gameObject.SetActive(false);
|
||||
MusicController.Instance.PlayerAudioClip(MusicController.Instance.MusicData.SfxMusic.HardCapture,
|
||||
MusicController.Instance.PlayRandomClip(MusicController.Instance.MusicData.SfxMusic.Captures,
|
||||
cell.gameObject);
|
||||
}));
|
||||
}
|
||||
@ -101,9 +101,8 @@ public class UnitView : MonoBehaviour
|
||||
|
||||
private void Land()
|
||||
{
|
||||
MusicController.Instance.PlayerAudioClip(
|
||||
MusicController.Instance.MusicData.SfxMusic.Step[
|
||||
Random.Range(0, MusicController.Instance.MusicData.SfxMusic.Step.Count - 1)], gameObject);
|
||||
MusicController.Instance.PlayRandomClip(
|
||||
MusicController.Instance.MusicData.SfxMusic.Step, gameObject);
|
||||
}
|
||||
|
||||
private void AttackEnd()
|
||||
|
@ -24,6 +24,6 @@ public class WeaponView : MonoBehaviour
|
||||
go.AddComponent<VFXView>();
|
||||
MusicController.Instance.AddAudioSource(go);
|
||||
MusicController.Instance.RemoveAudioSource(gameObject);
|
||||
MusicController.Instance.PlayerAudioClip(_weapon.hitSound, go);
|
||||
MusicController.Instance.PlayAudioClip(_weapon.hitSound, go);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user