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