fixed Rocket
This commit is contained in:
parent
0503421766
commit
020dbc4be6
@ -13,7 +13,7 @@ MonoBehaviour:
|
||||
m_Name: GlobalSerializationConfig
|
||||
m_EditorClassIdentifier:
|
||||
HideSerializationCautionaryMessage: 1
|
||||
HidePrefabCautionaryMessage: 0
|
||||
HidePrefabCautionaryMessage: 1
|
||||
HideOdinSerializeAttributeWarningMessages: 0
|
||||
HideNonSerializedShowInInspectorWarningMessages: 0
|
||||
buildSerializationFormat: 0
|
||||
|
@ -25,8 +25,8 @@ Transform:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 662838864788327244}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalRotation: {x: 0, y: 0.9985128, z: 0, w: 0.054518197}
|
||||
m_LocalPosition: {x: 20.317627, y: 0, z: 57.78}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 8618016098659616984}
|
||||
@ -136,8 +136,8 @@ MonoBehaviour:
|
||||
Entry: 8
|
||||
Data:
|
||||
_unit: {fileID: 0}
|
||||
_color: 0
|
||||
speed: 0.1
|
||||
_color: 3
|
||||
speed: 0.3
|
||||
--- !u!136 &7385595456525671967
|
||||
CapsuleCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -280,7 +280,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7418914791400950115, guid: 13431d38aaa99b8409a3e1ef301152d7, type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 0
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 13431d38aaa99b8409a3e1ef301152d7, type: 3}
|
||||
|
@ -130526,7 +130526,7 @@ MonoBehaviour:
|
||||
attackText: {fileID: 1033038899}
|
||||
reloadText: {fileID: 985521934}
|
||||
chosenWeaponDataPath: ChosenWeapon.json
|
||||
_data: {fileID: 0}
|
||||
_data: {fileID: 11400000, guid: 933ff56c36f8e2048ac179b755c821f7, type: 2}
|
||||
--- !u!1 &1550290323
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AI;
|
||||
using DefaultNamespace;
|
||||
using DG.Tweening;
|
||||
using HexFiled;
|
||||
using Sirenix.OdinInspector;
|
||||
@ -23,11 +24,22 @@ namespace Items.ItemViews
|
||||
{
|
||||
_unit = unit.Instance;
|
||||
_color = unit.Color;
|
||||
Rockets[_color].SetActive(true);
|
||||
GetNearestUnit();
|
||||
MoveToTarget();
|
||||
|
||||
}
|
||||
|
||||
private void MoveToTarget()
|
||||
{
|
||||
transform.DOKill();
|
||||
transform.LookAt(listUnits.First().transform);
|
||||
transform.DOMove(listUnits.First().transform.position,
|
||||
speed * Vector3.Distance(transform.position, listUnits.First().transform.position)).OnUpdate(
|
||||
MoveToTarget);
|
||||
}
|
||||
private void GetNearestUnit()
|
||||
{
|
||||
Rockets[_color].SetActive(true);
|
||||
listUnits = new List<GameObject>();
|
||||
listUnits.AddRange(HexManager.UnitCurrentCell.Where(x => x.Key != _color).ToList()
|
||||
.Select(x => x.Value.unit.Instance));
|
||||
@ -36,17 +48,6 @@ namespace Items.ItemViews
|
||||
Vector3.Distance(y.transform.position, _unit.transform.position)));
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (_unit != null)
|
||||
{
|
||||
GetNearestUnit();
|
||||
transform.DOKill();
|
||||
transform.LookAt(listUnits.First().transform);
|
||||
transform.DOMove(listUnits.First().transform.position,
|
||||
Vector3.Distance(listUnits.First().transform.position, _unit.transform.position) * speed)
|
||||
.SetEase(Ease.Linear);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -46,12 +46,12 @@ namespace Items
|
||||
|
||||
container.Unit.RotateUnit(container.Direction);
|
||||
_weapon.SetModifiedDamage(0);
|
||||
_weapon.objectToThrow.GetComponent<ISetUp>().SetUp(container.Unit);
|
||||
container.DeAim();
|
||||
|
||||
TimerHelper.Instance.StartTimer(() =>
|
||||
{
|
||||
var ball = _weapon.Fire(container.Unit.Instance.transform, container.Direction, container.Unit);
|
||||
var ball = _weapon.Fire(container.Unit.Instance.transform, container.Direction, container.Unit, false);
|
||||
ball.GetComponent<ISetUp>().SetUp(container.Unit);
|
||||
if (isLifeByTime)
|
||||
{
|
||||
TimerHelper.Instance.StartTimer(() =>
|
||||
|
@ -1,6 +1,3 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using Data;
|
||||
@ -8,8 +5,10 @@ using TMPro;
|
||||
using UnityEngine;
|
||||
using Weapons;
|
||||
|
||||
public class ChosenWeapon : MonoBehaviour
|
||||
namespace MainMenu
|
||||
{
|
||||
public class ChosenWeapon : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private TMP_Text attackText;
|
||||
[SerializeField] private TMP_Text reloadText;
|
||||
[SerializeField] private string chosenWeaponDataPath;
|
||||
@ -29,4 +28,5 @@ public class ChosenWeapon : MonoBehaviour
|
||||
attackText.text = weapon.damage.ToString();
|
||||
reloadText.text = weapon.reloadTime.ToString(CultureInfo.CurrentCulture);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,12 +1,11 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using DG.Tweening;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class FadeIn : MonoBehaviour
|
||||
namespace MainMenu
|
||||
{
|
||||
public class FadeIn : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private float duration;
|
||||
|
||||
|
||||
@ -15,4 +14,5 @@ public class FadeIn : MonoBehaviour
|
||||
var back = GetComponent<Image>();
|
||||
back.DOFade(0, duration).OnComplete(() => gameObject.SetActive(false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,36 +0,0 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using DG.Tweening;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class HighLightButton : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private GameObject highLighter;
|
||||
[SerializeField] private List<Button> _buttons;
|
||||
|
||||
[SerializeField] private float _duration;
|
||||
[SerializeField] private Ease _ease;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
List<Transform> buttonTransforms = new List<Transform>();
|
||||
foreach (var button in _buttons)
|
||||
{
|
||||
buttonTransforms.Add(button.transform);
|
||||
}
|
||||
|
||||
var i = 0;
|
||||
buttonTransforms.ForEach(x => { _buttons[i++].onClick.AddListener(() => Highlight(x)); });
|
||||
i = 0;
|
||||
}
|
||||
|
||||
private void Highlight(Transform buttonTransform)
|
||||
{
|
||||
highLighter.transform
|
||||
.DOMove(new Vector3(buttonTransform.position.x, highLighter.transform.position.y, 0), _duration)
|
||||
.SetEase(_ease);
|
||||
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d617def8d366147408d8fa6b815a1135
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,10 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Scene = UnityEngine.SceneManagement.Scene;
|
||||
[CreateAssetMenu(fileName = "LevelData", menuName = "Data/LevelData", order = 0)]
|
||||
public class LevelData : ScriptableObject
|
||||
|
||||
namespace MainMenu
|
||||
{
|
||||
[CreateAssetMenu(fileName = "LevelData", menuName = "Data/LevelData", order = 0)]
|
||||
public class LevelData : ScriptableObject
|
||||
{
|
||||
[Serializable]
|
||||
public struct Level
|
||||
{
|
||||
@ -15,4 +17,5 @@ public class LevelData : ScriptableObject
|
||||
[SerializeField] private List<Level> levels;
|
||||
|
||||
public List<Level> Levels => levels;
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,11 @@
|
||||
using System.IO;
|
||||
using DefaultNamespace;
|
||||
using DG.Tweening;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using AudioSettings = MainMenu.AudioSettings;
|
||||
|
||||
public class SettingsController : MonoBehaviour
|
||||
namespace MainMenu
|
||||
{
|
||||
public class SettingsController : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private AudioSource menuMusSrc;
|
||||
[SerializeField] private string dataFilePath;
|
||||
[SerializeField] private Slider musicSlider;
|
||||
@ -82,4 +81,5 @@ public class SettingsController : MonoBehaviour
|
||||
{
|
||||
menuMusSrc.volume = musicSlider.value;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,17 +1,14 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using DanielLochner.Assets.SimpleScrollSnap;
|
||||
using DG.Tweening;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
|
||||
public class ToolBarController : MonoBehaviour
|
||||
namespace MainMenu
|
||||
{
|
||||
public class ToolBarController : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private List<Button> buttons;
|
||||
[SerializeField] private SimpleScrollSnap _scrollSnap;
|
||||
[SerializeField] private bool hasHightlighter;
|
||||
@ -50,4 +47,5 @@ public class ToolBarController : MonoBehaviour
|
||||
.DOMove(new Vector3(buttonTransform.position.x, highLighter.transform.position.y, 0), duration)
|
||||
.SetEase(ease);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,11 +1,11 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class WeaponIcon : MonoBehaviour
|
||||
namespace MainMenu
|
||||
{
|
||||
public class WeaponIcon : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private Button button;
|
||||
[SerializeField] private TMP_Text damageText;
|
||||
[SerializeField] private TMP_Text shotsCount;
|
||||
@ -21,4 +21,5 @@ public class WeaponIcon : MonoBehaviour
|
||||
public TMP_Text ShotsCount => shotsCount;
|
||||
public TMP_Text WeaponTitle => weaponTitle;
|
||||
public GameObject Icon => icon;
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Data;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using Weapons;
|
||||
|
||||
public class WeaponSelection : MonoBehaviour
|
||||
namespace MainMenu
|
||||
{
|
||||
public class WeaponSelection : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private WeaponsData data;
|
||||
[SerializeField] private WeaponIcon weaponIcon;
|
||||
[SerializeField] private Transform grid;
|
||||
@ -51,4 +51,5 @@ public class WeaponSelection : MonoBehaviour
|
||||
writer.Write($"{i}");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -30,7 +30,7 @@ namespace Weapons
|
||||
modifiedDamage = damage + bonus;
|
||||
}
|
||||
|
||||
public GameObject Fire(Transform start, Vector2 direction, Unit unit)
|
||||
public GameObject Fire(Transform start, Vector2 direction, Unit unit, bool isMoving = true)
|
||||
{
|
||||
var ball = Object.Instantiate(objectToThrow,
|
||||
start.forward + start.transform.position + new Vector3(0, 1),
|
||||
@ -40,9 +40,11 @@ namespace Weapons
|
||||
MusicController.Instance.PlayAudioClip(shotSound, ball);
|
||||
ball.AddComponent<WeaponView>().SetWeapon(this, unit);
|
||||
Weapon tmpThis = this;
|
||||
GameObject localBall = ball;
|
||||
|
||||
Weapon tmpThis1 = this;
|
||||
localBall.transform.DOMove(new Vector3(direction.normalized.x,
|
||||
if (isMoving)
|
||||
{
|
||||
ball.transform.DOMove(new Vector3(direction.normalized.x,
|
||||
0, direction.normalized.y) * tmpThis.disnatce * HexGrid.HexDistance +
|
||||
start.position + new Vector3(0, 1, 0), tmpThis.speed)
|
||||
.SetEase(Ease.Linear)
|
||||
@ -60,6 +62,8 @@ namespace Weapons
|
||||
ball.transform.DOKill();
|
||||
Object.Destroy(ball);
|
||||
});
|
||||
}
|
||||
|
||||
return ball;
|
||||
}
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user