Misc. Improvements
Turrets lead their projectiles Double click to equip/unequip/move Minimum weapon convergence distance
This commit is contained in:
parent
8629b35fd6
commit
922c8ea460
18 changed files with 240 additions and 69 deletions
41
Assets/Scripts/Gameplay/GameSettings.cs
Normal file
41
Assets/Scripts/Gameplay/GameSettings.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu(fileName = "Sector Display Properties", menuName = "Aetheria/Sector Display Properties")]
|
||||
public class GameSettings : ScriptableObject
|
||||
{
|
||||
public float DefaultZoneRadius;
|
||||
public float DefaultZoneMass;
|
||||
public float DefaultViewDistance;
|
||||
public float MinimapZoneGravityRange;
|
||||
public float[] MinimapZoomLevels;
|
||||
public int DefaultMinimapZoom;
|
||||
public ExponentialCurve IconSize;
|
||||
public int AsteroidMeshCount = 5;
|
||||
public float MinimapAsteroidSize = 3;
|
||||
public float PlanetRotationSpeed = 1;
|
||||
public BodySettingsCollection[] BodySettingsCollections;
|
||||
public PlanetSettings PlanetSettings;
|
||||
public ZoneGenerationSettings ZoneSettings;
|
||||
public GameplaySettings GameplaySettings;
|
||||
public Color HullHitColor;
|
||||
public Color ArmorHitColor;
|
||||
public Color HardpointHitColor;
|
||||
public Color GearHitColor;
|
||||
public Gradient ArmorGradient;
|
||||
public Gradient DurabilityGradient;
|
||||
[HideInInspector] public Sprite[] ItemIcons;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class BodySettingsCollection
|
||||
{
|
||||
public float MinimumMass;
|
||||
public CelestialBodySettings[] BodySettings;
|
||||
}
|
||||
11
Assets/Scripts/Gameplay/GameSettings.cs.meta
Normal file
11
Assets/Scripts/Gameplay/GameSettings.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0d957fc3cdc9310499a3a494a317fe0a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -65,7 +65,7 @@ public class GuidedProjectile : MonoBehaviour
|
|||
}
|
||||
|
||||
var diff = Target.position - transform.position;
|
||||
var targetDist = diff.magnitude;
|
||||
var targetDist = diff.Flatland().magnitude;
|
||||
|
||||
if (_prevDist < targetDist)
|
||||
{
|
||||
|
|
@ -74,7 +74,7 @@ public class GuidedProjectile : MonoBehaviour
|
|||
_prevDist = targetDist;
|
||||
|
||||
var position = (float3) t.position;
|
||||
var sourceDist = length((float3) Source.position - position);
|
||||
var sourceDist = length(((float3) Source.position).xz - position.xz);
|
||||
var curveLerp = 1 - targetDist / (sourceDist + targetDist);
|
||||
var dir = diff.normalized;
|
||||
var right = cross(dir, float3(0, 1, 0));
|
||||
|
|
|
|||
Loading…
Reference in a new issue