NEW CLOUDS NEW CLOUDS NEW CLOUDS WHOOO
Added new clouds shader with improved raymarching loop Currently only being used in main menu (rest is coming right up!) Removed WWise (it's nice, but all it's doing is throwing exceptions rn since we ain't about to get a license)
This commit is contained in:
parent
4a369a1266
commit
b08423b936
1066 changed files with 9806 additions and 58766 deletions
|
|
@ -231,102 +231,4 @@ public class ShapeSchematicInspector : BaseInspector<Shape, InspectableSchematic
|
|||
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
public class WwiseSoundBankInspector : BaseInspector<uint, InspectableSoundBankAttribute>
|
||||
{
|
||||
public override uint Inspect(string label, uint value, object parent, DatabaseInspector inspectorWindow, InspectableSoundBankAttribute attribute)
|
||||
{
|
||||
using (new HorizontalScope())
|
||||
{
|
||||
GUILayout.Label(label, GUILayout.Width(width));
|
||||
|
||||
IEnumerable<WwiseMetaSoundBank> soundBanks = ActionGameManager.SoundBanksInfo.SoundBanks;
|
||||
|
||||
if (parent is EquippableItemData item)
|
||||
{
|
||||
if (item.Behaviors.Any(b => b is WeaponData))
|
||||
soundBanks = soundBanks.Where(s => s.GetEvent(WeaponAudioEvent.Fire) != null);
|
||||
|
||||
if (item.Behaviors.Any(b => b is ChargedWeaponData))
|
||||
soundBanks = soundBanks.Where(s => s.GetEvent(ChargedWeaponAudioEvent.Start) != null);
|
||||
|
||||
if (item.Behaviors.Any(b => b is ReactorData || b is ThrusterData || b is AetherDriveData))
|
||||
soundBanks = soundBanks.Where(s =>
|
||||
s.GetEvent(LoopingAudioEvent.Play) != null &&
|
||||
s.GetEvent(LoopingAudioEvent.Stop) != null &&
|
||||
s.GetParameter(SpecialAudioParameter.Intensity) != null);
|
||||
}
|
||||
else if (parent is Faction)
|
||||
{
|
||||
soundBanks = soundBanks.Where(s => s.ObjectPath.Contains("Music") &&
|
||||
s.GetEvent(LoopingAudioEvent.Play) != null &&
|
||||
s.GetEvent(LoopingAudioEvent.Stop) != null);
|
||||
}
|
||||
else
|
||||
{
|
||||
using (new HorizontalScope(GUI.skin.box))
|
||||
{
|
||||
GUILayout.Label("Unsupported Parent Type!");
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
var soundBanksArray = soundBanks.ToArray();
|
||||
|
||||
if (soundBanksArray.Length==0)
|
||||
{
|
||||
using (new HorizontalScope(GUI.skin.box))
|
||||
{
|
||||
GUILayout.Label("Sound bank not found!");
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
var selected = Array.FindIndex(soundBanksArray, o=>o.Id==value);
|
||||
if (selected == -1) selected = 0;
|
||||
else selected++;
|
||||
|
||||
var selection = Popup(selected, soundBanksArray.Select(p => p.ShortName).Prepend("None").ToArray());
|
||||
value = selection != 0 ? soundBanksArray[selection - 1].Id : 0;
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class WwiseParameterBindingInspector : BaseInspector<uint, InspectableAudioParameterAttribute>
|
||||
{
|
||||
public override uint Inspect(string label, uint value, object parent, DatabaseInspector inspectorWindow, InspectableAudioParameterAttribute attribute)
|
||||
{
|
||||
using (new HorizontalScope())
|
||||
{
|
||||
GUILayout.Label(label, GUILayout.Width(width));
|
||||
|
||||
var item = parent as EquippableItemData;
|
||||
if (item == null)
|
||||
{
|
||||
using (new HorizontalScope(GUI.skin.box))
|
||||
{
|
||||
GUILayout.Label("Unsupported Parent Type!");
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
var soundbank = ActionGameManager.SoundBanksInfo.SoundBanks.FirstOrDefault(s => s.Id == item.SoundBank);
|
||||
if (soundbank == null)
|
||||
{
|
||||
using (new HorizontalScope(GUI.skin.box))
|
||||
{
|
||||
GUILayout.Label("Sound bank not found!");
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
var selected = Array.FindIndex(soundbank.GameParameters, o=>o.Id==value);
|
||||
if (selected == -1) selected = 0;
|
||||
|
||||
value = soundbank.GameParameters[Popup(selected, soundbank.GameParameters.Select(p => p.Name).ToArray())].Id;
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -37,45 +37,6 @@ public class ActionGameManager : MonoBehaviour
|
|||
get => _gameDataDirectory ??= new DirectoryInfo(Application.dataPath).Parent.CreateSubdirectory("GameData");
|
||||
}
|
||||
|
||||
private static WwiseMetaSoundBanksInfo _soundBanksInfo;
|
||||
public static WwiseMetaSoundBanksInfo SoundBanksInfo => _soundBanksInfo ??=
|
||||
JsonConvert.DeserializeObject<WwiseMetadataFile>(File.ReadAllText(Path.Combine(GameDataDirectory.FullName, "SoundbanksInfo.json")))
|
||||
.SoundBanksInfo;
|
||||
|
||||
private static HashSet<uint> _loadedSoundBanks = new HashSet<uint>();
|
||||
public static void LoadSoundbank(uint soundBank)
|
||||
{
|
||||
if (!_loadedSoundBanks.Contains(soundBank))
|
||||
{
|
||||
AkSoundEngine.LoadBank(SoundBanksInfo.GetSoundBank(soundBank).ShortName, out _);
|
||||
_loadedSoundBanks.Add(soundBank);
|
||||
}
|
||||
}
|
||||
|
||||
private static GameObject CurrentMusicGameObject;
|
||||
private static uint CurrentMusicSoundbank;
|
||||
public static void PlayMusic(uint soundBank, GameObject obj)
|
||||
{
|
||||
if (soundBank == CurrentMusicSoundbank) return;
|
||||
if (CurrentMusicSoundbank != 0)
|
||||
AkSoundEngine.PostEvent(SoundBanksInfo.GetSoundBank(CurrentMusicSoundbank)
|
||||
.GetEvent(LoopingAudioEvent.Stop).Id, CurrentMusicGameObject);
|
||||
LoadSoundbank(soundBank);
|
||||
CurrentMusicGameObject = obj;
|
||||
CurrentMusicSoundbank = soundBank;
|
||||
AkSoundEngine.PostEvent(SoundBanksInfo.GetSoundBank(CurrentMusicSoundbank)
|
||||
.GetEvent(LoopingAudioEvent.Play).Id, CurrentMusicGameObject);
|
||||
}
|
||||
|
||||
public static void StopMusic()
|
||||
{
|
||||
if (CurrentMusicSoundbank != 0)
|
||||
AkSoundEngine.PostEvent(SoundBanksInfo.GetSoundBank(CurrentMusicSoundbank)
|
||||
.GetEvent(LoopingAudioEvent.Stop).Id, CurrentMusicGameObject);
|
||||
CurrentMusicGameObject = null;
|
||||
CurrentMusicSoundbank = 0;
|
||||
}
|
||||
|
||||
private static CultCache _cultCache;
|
||||
|
||||
public static CultCache CultCache
|
||||
|
|
@ -281,13 +242,6 @@ public class ActionGameManager : MonoBehaviour
|
|||
private void OnDisable()
|
||||
{
|
||||
Input.Dispose();
|
||||
var ambience = SoundBanksInfo.GetSoundBank(Settings.AmbienceSoundBank);
|
||||
foreach (var stopEvent in ambience.IncludedEvents.Where(e => e.Name.EndsWith("_stop")))
|
||||
{
|
||||
AkSoundEngine.PostEvent(stopEvent.Id, gameObject);
|
||||
}
|
||||
StopMusic();
|
||||
AkSoundEngine.UnregisterGameObj(gameObject);
|
||||
ConsoleController.ClearCommands();
|
||||
EntityInstance.ClearWeaponManagers();
|
||||
}
|
||||
|
|
@ -296,15 +250,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
{
|
||||
Instance = this;
|
||||
EntityInstance.EffectManagerParent = EffectManagerParent;
|
||||
AkSoundEngine.RegisterGameObj(gameObject);
|
||||
ConsoleController.MessageReceiver = this;
|
||||
|
||||
var ambience = SoundBanksInfo.GetSoundBank(Settings.AmbienceSoundBank);
|
||||
LoadSoundbank(ambience.Id);
|
||||
foreach (var playEvent in ambience.IncludedEvents.Where(e => e.Name.EndsWith("_play")))
|
||||
{
|
||||
AkSoundEngine.PostEvent(playEvent.Id, gameObject);
|
||||
}
|
||||
|
||||
ItemManager = new ItemManager(CultCache, Settings.GameplaySettings, Debug.Log);
|
||||
ZoneRenderer.ItemManager = ItemManager;
|
||||
|
|
@ -345,7 +291,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
if (MainMenu.gameObject.activeSelf) return;
|
||||
if (CurrentEntity == null)
|
||||
{
|
||||
AkSoundEngine.PostEvent("UI_Fail", gameObject);
|
||||
// TODO: SFX: Fail
|
||||
Dialog.Clear();
|
||||
Dialog.Title.text = "Can't undock. You dont have a ship!";
|
||||
Dialog.Show();
|
||||
|
|
@ -387,7 +333,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
Input.Player.ToggleHeatsinks.performed += context =>
|
||||
{
|
||||
CurrentEntity.HeatsinksEnabled = !CurrentEntity.HeatsinksEnabled;
|
||||
AkSoundEngine.PostEvent(CurrentEntity.HeatsinksEnabled ? "UI_Success" : "UI_Fail", gameObject);
|
||||
// TODO: SFX: Success/Fail
|
||||
};
|
||||
|
||||
Input.Player.ToggleShield.performed += context =>
|
||||
|
|
@ -395,7 +341,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
if (CurrentEntity.Shield != null)
|
||||
{
|
||||
CurrentEntity.Shield.Item.Enabled.Value = !CurrentEntity.Shield.Item.Enabled.Value;
|
||||
AkSoundEngine.PostEvent(CurrentEntity.Shield.Item.Enabled.Value ? "UI_Success" : "UI_Fail", gameObject);
|
||||
// TODO: SFX: Success/Fail
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -856,7 +802,8 @@ public class ActionGameManager : MonoBehaviour
|
|||
{
|
||||
UnbindEntity();
|
||||
DoDock(entity, bay);
|
||||
AkSoundEngine.PostEvent("Dock", gameObject);
|
||||
// TODO: SFX: Docking
|
||||
//AkSoundEngine.PostEvent("Dock", gameObject);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -895,7 +842,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
Dialog.Title.text = "Can't undock. Missing cockpit component!";
|
||||
Dialog.Show();
|
||||
Dialog.MoveToCursor();
|
||||
AkSoundEngine.PostEvent("UI_Fail", gameObject);
|
||||
// TODO: SFX: Fail
|
||||
}
|
||||
else if (CurrentEntity.GetBehavior<Thruster>() == null && CurrentEntity.GetBehavior<AetherDrive>() == null)
|
||||
{
|
||||
|
|
@ -903,7 +850,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
Dialog.Title.text = "Can't undock. Missing thruster component!";
|
||||
Dialog.Show();
|
||||
Dialog.MoveToCursor();
|
||||
AkSoundEngine.PostEvent("UI_Fail", gameObject);
|
||||
// TODO: SFX: Fail
|
||||
}
|
||||
else if (CurrentEntity.GetBehavior<Reactor>() == null)
|
||||
{
|
||||
|
|
@ -911,19 +858,19 @@ public class ActionGameManager : MonoBehaviour
|
|||
Dialog.Title.text = "Can't undock. Missing reactor component!";
|
||||
Dialog.Show();
|
||||
Dialog.MoveToCursor();
|
||||
AkSoundEngine.PostEvent("UI_Fail", gameObject);
|
||||
// TODO: SFX: Fail
|
||||
}
|
||||
else if (CurrentEntity.Parent.TryUndock(ship))
|
||||
{
|
||||
BindToEntity(ship);
|
||||
AkSoundEngine.PostEvent("Undock", gameObject);
|
||||
// TODO: SFX: Undock
|
||||
}
|
||||
else
|
||||
{
|
||||
Dialog.Title.text = "Can't undock. Must empty docking bay!";
|
||||
Dialog.Show();
|
||||
Dialog.MoveToCursor();
|
||||
AkSoundEngine.PostEvent("UI_Fail", gameObject);
|
||||
// TODO: SFX: Fail
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1190,22 +1137,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
|
||||
public void PlayMusic(MusicType type)
|
||||
{
|
||||
var soundbank = type switch
|
||||
{
|
||||
MusicType.Overworld => Zone.GalaxyZone.Owner?.OverworldMusic ?? 0,
|
||||
MusicType.Combat => Zone.GalaxyZone.Owner?.CombatMusic ?? 0,
|
||||
MusicType.Boss => Zone.GalaxyZone.Owner?.BossMusic ?? 0,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(type), type, null)
|
||||
};
|
||||
if (soundbank == 0)
|
||||
soundbank = type switch
|
||||
{
|
||||
MusicType.Overworld => SoundBanksInfo.GetSoundBank(Settings.DefaultOverworldSoundbank).Id,
|
||||
MusicType.Combat => SoundBanksInfo.GetSoundBank(Settings.DefaultCombatSoundbank).Id,
|
||||
MusicType.Boss => SoundBanksInfo.GetSoundBank(Settings.DefaultBossSoundbank).Id,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(type), type, null)
|
||||
};
|
||||
PlayMusic(soundbank, gameObject);
|
||||
// TODO: SFX: Music
|
||||
}
|
||||
|
||||
void Update()
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public class EntityInstance : MonoBehaviour
|
|||
private Sensor _sensor;
|
||||
private Transform _influenceInstance;
|
||||
|
||||
private List<(GameObject source, EquippedItem item)> _audioSources = new List<(GameObject source, EquippedItem item)>();
|
||||
//private List<(GameObject source, EquippedItem item)> _audioSources = new List<(GameObject source, EquippedItem item)>();
|
||||
// private (Reactor reactor, GameObject sfxSource) _reactor;
|
||||
// private Dictionary<Radiator, GameObject> _radiatorSfx = new Dictionary<Radiator, GameObject>();
|
||||
|
||||
|
|
@ -242,17 +242,6 @@ public class EntityInstance : MonoBehaviour
|
|||
if (hardpointTransform != null)
|
||||
{
|
||||
var hardpointGameObject = hardpointTransform.gameObject;
|
||||
_audioSources.Add((hardpointGameObject, item));
|
||||
AkSoundEngine.RegisterGameObj(hardpointGameObject);
|
||||
ActionGameManager.LoadSoundbank(item.Data.SoundBank);
|
||||
_subscriptions.Add(item.AudioEvents.Subscribe(e=>AkSoundEngine.PostEvent(e, hardpointGameObject)));
|
||||
_subscriptions.Add(item.AudioParameters.Subscribe(p=>AkSoundEngine.SetRTPCValue(p.id, p.v, hardpointGameObject)));
|
||||
var soundBank = ActionGameManager.SoundBanksInfo.GetSoundBank(item.Data.SoundBank);
|
||||
item.SoundBank = soundBank;
|
||||
if (soundBank.GetEvent(LoopingAudioEvent.Play) != null && soundBank.GetEvent(ChargedWeaponAudioEvent.Start) == null)
|
||||
{
|
||||
AkSoundEngine.PostEvent(soundBank.GetEvent(LoopingAudioEvent.Play).Id, hardpointGameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -469,10 +458,6 @@ public class EntityInstance : MonoBehaviour
|
|||
|
||||
public virtual void Update()
|
||||
{
|
||||
foreach (var (source, item) in _audioSources)
|
||||
{
|
||||
AkSoundEngine.SetObjectPosition(source, source.transform);
|
||||
}
|
||||
if (_currentPing.transform)
|
||||
{
|
||||
_currentPing.transform.localScale = _sensor.PingRadius * Vector3.one;
|
||||
|
|
@ -536,15 +521,6 @@ public class EntityInstance : MonoBehaviour
|
|||
{
|
||||
if (_influenceInstance) Destroy(_influenceInstance.gameObject);
|
||||
Destroy(LocalSpace.gameObject);
|
||||
foreach (var (source, item) in _audioSources)
|
||||
{
|
||||
var soundBank = ActionGameManager.SoundBanksInfo.GetSoundBank(item.Data.SoundBank);
|
||||
if (soundBank.GetEvent(LoopingAudioEvent.Stop) != null)
|
||||
{
|
||||
AkSoundEngine.PostEvent(soundBank.GetEvent(LoopingAudioEvent.Stop).Id, source);
|
||||
}
|
||||
AkSoundEngine.UnregisterGameObj(source);
|
||||
}
|
||||
foreach(var x in _subscriptions)
|
||||
x.Dispose();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ namespace JsonKnownTypes
|
|||
}
|
||||
else
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
throw new ArgumentException($"Json Known Types: Type Unknown {objectType.FullName}!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,10 @@ public class NebulaSettings
|
|||
[JsonProperty("fogOffset"), Key(4)] public float FloorOffset;
|
||||
[JsonProperty("fogBlend"), Key(5)] public float FloorBlend;
|
||||
[JsonProperty("cloudBlend"), Key(6)] public float PatchBlend;
|
||||
[JsonProperty("luminance"), Key(7)] public float Luminance;
|
||||
[JsonProperty("tintExponent"), Key(8)] public float TintExponent;
|
||||
[JsonProperty("tintLodExponent"), Key(9)] public float TintLodExponent;
|
||||
[JsonProperty("safetyDistance"), Key(10)] public float SafetyDistance;
|
||||
}
|
||||
|
||||
[Serializable, MessagePackObject, JsonObject(MemberSerialization.OptIn)]
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ public class ItemManager
|
|||
{
|
||||
if (item == null)
|
||||
{
|
||||
_logger("Attempted to create crafted item instance using missing or incorrect item data!");
|
||||
throw new NullReferenceException("Attempted to create crafted item instance using missing or incorrect item data!");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ public class InventoryMenu : MonoBehaviour
|
|||
|
||||
private void OnEnable()
|
||||
{
|
||||
AkSoundEngine.RegisterGameObj(gameObject);
|
||||
// Background.gameObject.SetActive(true);
|
||||
|
||||
// Background.OnEnter.Subscribe(enter =>
|
||||
|
|
@ -70,7 +69,6 @@ public class InventoryMenu : MonoBehaviour
|
|||
|
||||
private void OnDisable()
|
||||
{
|
||||
AkSoundEngine.UnregisterGameObj(gameObject);
|
||||
// Background.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
|
|
@ -92,12 +90,13 @@ public class InventoryMenu : MonoBehaviour
|
|||
if (otherPanel.CanDropItem(item))
|
||||
{
|
||||
otherPanel.DropItem(item);
|
||||
AkSoundEngine.PostEvent("Equip", gameObject);
|
||||
// TODO: SFX: Equip
|
||||
cargoEvent.CargoBay.Remove(item);
|
||||
panel.RefreshCells();
|
||||
otherPanel.RefreshCells();
|
||||
}
|
||||
else AkSoundEngine.PostEvent("UI_Fail", gameObject);
|
||||
// else
|
||||
// TODO: SFX: Fail
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -124,7 +123,7 @@ public class InventoryMenu : MonoBehaviour
|
|||
var v2 = _selectedItemData.Shape.Rotate(v, _selectedItem.Rotation) + _selectedPosition;
|
||||
_selectedPanel.CellInstances[v2].Icon.color = _selectedPanel.GetColor(v2, true);
|
||||
}
|
||||
AkSoundEngine.PostEvent("UI_Success", gameObject);
|
||||
// TODO: SFX: Success
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -143,13 +142,15 @@ public class InventoryMenu : MonoBehaviour
|
|||
if (entityEvent.Entity.TryUnequip(item) != null)
|
||||
{
|
||||
otherPanel.DropItem(item.EquippableItem);
|
||||
AkSoundEngine.PostEvent("Unequip", gameObject);
|
||||
// TODO: SFX: Unequip
|
||||
panel.RefreshCells();
|
||||
otherPanel.RefreshCells();
|
||||
}
|
||||
else AkSoundEngine.PostEvent("UI_Fail", gameObject);
|
||||
// else
|
||||
// TODO: SFX: Fail
|
||||
}
|
||||
else AkSoundEngine.PostEvent("UI_Fail", gameObject);
|
||||
// else
|
||||
// TODO: SFX: Fail
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -176,7 +177,7 @@ public class InventoryMenu : MonoBehaviour
|
|||
var v2 = _selectedItemData.Shape.Rotate(v, _selectedItem.Rotation) + _selectedPosition;
|
||||
_selectedPanel.CellInstances[v2].Icon.color = _selectedPanel.GetColor(v2, true);
|
||||
}
|
||||
AkSoundEngine.PostEvent("UI_Success", gameObject);
|
||||
// TODO: SFX: Success
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -379,7 +379,8 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
RefreshCells();
|
||||
_originalRotation = item.EquippableItem.Rotation;
|
||||
GameManager.BeginDrag(new EquippedItemDragObject(item, entity, item.Position - v));
|
||||
AkSoundEngine.PostEvent("Pickup", gameObject);
|
||||
//AkSoundEngine.PostEvent("Pickup", gameObject);
|
||||
// TODO: SFX: Pickup Item
|
||||
}
|
||||
});
|
||||
cell.DragTrigger.OnDragAsObservable()
|
||||
|
|
@ -425,15 +426,17 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
{
|
||||
if(equippedItemDragObject.OriginEntity.TryUnequip(equippedItemDragObject.EquippedItem) == null)
|
||||
{
|
||||
AkSoundEngine.PostEvent("UI_Fail", gameObject);
|
||||
// AkSoundEngine.PostEvent("UI_Fail", gameObject);
|
||||
// TODO: SFX: Fail
|
||||
Dialog.Clear();
|
||||
Dialog.Title.text = "Unable to move item!";
|
||||
Dialog.AddProperty("Verify that cargo bays are empty before un-equipping them.");
|
||||
Dialog.Show();
|
||||
Dialog.MoveToCursor();
|
||||
}
|
||||
else
|
||||
AkSoundEngine.PostEvent("Unequip", gameObject);
|
||||
// else
|
||||
// AkSoundEngine.PostEvent("Unequip", gameObject);
|
||||
// TODO: SFX: Unequip
|
||||
}
|
||||
else if (GameManager.DragObject is ItemInstanceDragObject itemInstanceDragObject)
|
||||
itemInstanceDragObject.OriginInventory.Remove(itemInstanceDragObject.Item);
|
||||
|
|
@ -441,7 +444,7 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
FakeOccupancy = null;
|
||||
entity.TryEquip(equippableItem, placementPosition);
|
||||
RefreshCells();
|
||||
AkSoundEngine.PostEvent("Equip", gameObject);
|
||||
// TODO: SFX: Equip
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
|
@ -601,7 +604,7 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
RefreshCells();
|
||||
_originalRotation = item.Rotation;
|
||||
GameManager.BeginDrag(new ItemInstanceDragObject(item, cargo, cargo.Cargo[item] - v));
|
||||
AkSoundEngine.PostEvent("Pickup", gameObject);
|
||||
// TODO: SFX: Pickup
|
||||
}
|
||||
});
|
||||
cell.DragTrigger.OnDragAsObservable()
|
||||
|
|
@ -644,21 +647,21 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
{
|
||||
if(equippedItemDragObject.OriginEntity.TryUnequip(equippedItemDragObject.EquippedItem) == null)
|
||||
{
|
||||
AkSoundEngine.PostEvent("UI_Fail", gameObject);
|
||||
// TODO: SFX: Fail
|
||||
Dialog.Clear();
|
||||
Dialog.Title.text = "Unable to move item!";
|
||||
Dialog.AddProperty("Verify that cargo bays are empty before un-equipping them.");
|
||||
Dialog.Show();
|
||||
Dialog.MoveToCursor();
|
||||
}
|
||||
else
|
||||
AkSoundEngine.PostEvent("Unequip", gameObject);
|
||||
//else
|
||||
// TODO: SFX: Unequip
|
||||
}
|
||||
else if (GameManager.DragObject is ItemInstanceDragObject itemInstanceDragObject)
|
||||
itemInstanceDragObject.OriginInventory.Remove(itemInstanceDragObject.Item);
|
||||
cargo.TryStore(item, placementPosition);
|
||||
FakeOccupancy = null;
|
||||
AkSoundEngine.PostEvent("Drop", gameObject);
|
||||
// TODO: SFX: Drop
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,11 +13,11 @@ using static Unity.Mathematics.noise;
|
|||
/// <summary>
|
||||
/// Drives the volume render.
|
||||
/// </summary>
|
||||
//[ExecuteInEditMode]
|
||||
[RequireComponent( typeof( Camera ) ), ImageEffectAllowedInSceneView]
|
||||
[ExecuteInEditMode]
|
||||
[RequireComponent( typeof( Camera ) )]
|
||||
public class VolumeSampling : MonoBehaviour
|
||||
{
|
||||
[FormerlySerializedAs("_volMaterial")] public Material VolMaterial;
|
||||
public Material VolMaterial;
|
||||
public Transform GridTransform;
|
||||
public GameSettings Settings;
|
||||
//public int DownsampleBlurMask = 2;
|
||||
|
|
@ -44,31 +44,35 @@ public class VolumeSampling : MonoBehaviour
|
|||
_disabledBlurMask = Color.black.ToTexture();
|
||||
}
|
||||
|
||||
[ImageEffectOpaque]
|
||||
void OnRenderImage(RenderTexture source, RenderTexture destination)
|
||||
private void OnPreRender()
|
||||
{
|
||||
// check for no shader / shader compile error
|
||||
if( VolMaterial == null )
|
||||
{
|
||||
Graphics.Blit(source, destination);
|
||||
return;
|
||||
}
|
||||
|
||||
// Shader needs this matrix to generate world space rays
|
||||
VolMaterial.SetMatrix("_CamProj", (_camera.projectionMatrix * _camera.worldToCameraMatrix).inverse);
|
||||
VolMaterial.SetMatrix("_CamInvProj", (_camera.projectionMatrix * _camera.worldToCameraMatrix).inverse);
|
||||
Shader.SetGlobalMatrix("_CamProj", (Camera.current.projectionMatrix * Camera.current.worldToCameraMatrix).inverse);
|
||||
Shader.SetGlobalMatrix("_CamInvProj", (Camera.current.projectionMatrix * Camera.current.worldToCameraMatrix).inverse);
|
||||
}
|
||||
|
||||
//[ImageEffectOpaque]
|
||||
void Update()
|
||||
{
|
||||
// // check for no shader / shader compile error
|
||||
// if( VolMaterial == null )
|
||||
// {
|
||||
// Graphics.Blit(source, destination);
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
|
||||
// Shader needs to know the position and scale of cameras used to render input textures
|
||||
if(GridTransform != null)
|
||||
VolMaterial.SetVector("_GridTransform", new Vector4(GridTransform.position.x,GridTransform.position.z,GridTransform.localScale.x));
|
||||
|
||||
_mrt[0] = destination.colorBuffer;
|
||||
_mrt[1] = _blurMask.colorBuffer;
|
||||
|
||||
// Blit with a MRT.
|
||||
Graphics.SetRenderTarget(_mrt, source.depthBuffer);
|
||||
|
||||
Graphics.Blit( source, VolMaterial, 0 );
|
||||
Shader.SetGlobalVector("_GridTransform", new Vector4(GridTransform.position.x,GridTransform.position.z,GridTransform.localScale.x));
|
||||
//
|
||||
// _mrt[0] = destination.colorBuffer;
|
||||
// _mrt[1] = _blurMask.colorBuffer;
|
||||
//
|
||||
// // Blit with a MRT.
|
||||
// Graphics.SetRenderTarget(_mrt, source.depthBuffer);
|
||||
//
|
||||
// Graphics.Blit( source, VolMaterial, 0 );
|
||||
|
||||
//Graphics.Blit(rt1, destination);
|
||||
|
||||
|
|
@ -89,16 +93,20 @@ public class VolumeSampling : MonoBehaviour
|
|||
Shader.SetGlobalFloat("_NebulaFloorOffset", Settings.DefaultEnvironment.Nebula.FloorOffset);
|
||||
Shader.SetGlobalFloat("_NebulaFloorBlend", Settings.DefaultEnvironment.Nebula.FloorBlend);
|
||||
Shader.SetGlobalFloat("_NebulaPatchBlend", Settings.DefaultEnvironment.Nebula.PatchBlend);
|
||||
// Shader.SetGlobalFloat("_TintExponent", Settings.DefaultEnvironment.);
|
||||
Shader.SetGlobalFloat("_NebulaLuminance", Settings.DefaultEnvironment.Nebula.Luminance);
|
||||
Shader.SetGlobalFloat("_TintExponent", Settings.DefaultEnvironment.Nebula.TintExponent);
|
||||
Shader.SetGlobalFloat("_TintLodExponent", Settings.DefaultEnvironment.Nebula.TintLodExponent);
|
||||
Shader.SetGlobalFloat("_SafetyDistance", Settings.DefaultEnvironment.Nebula.SafetyDistance);
|
||||
|
||||
Shader.SetGlobalFloat("_NoiseScale", Settings.DefaultEnvironment.Noise.Scale);
|
||||
Shader.SetGlobalFloat("_NoiseExponent", Settings.DefaultEnvironment.Noise.Exponent);
|
||||
Shader.SetGlobalFloat("_NoiseAmplitude", Settings.DefaultEnvironment.Noise.Amplitude);
|
||||
Shader.SetGlobalFloat("_NoiseSpeed", Settings.DefaultEnvironment.Noise.Speed);
|
||||
|
||||
Shader.SetGlobalFloat("_FlowScale", Settings.DefaultEnvironment.Flow.Scale);
|
||||
Shader.SetGlobalFloat("_FlowAmplitude", Settings.DefaultEnvironment.Flow.Amplitude);
|
||||
_flowScroll += Settings.DefaultEnvironment.Flow.ScrollSpeed * Time.deltaTime;
|
||||
Shader.SetGlobalFloat("_FlowScroll", _flowScroll);
|
||||
Shader.SetGlobalFloat("_FlowSpeed", Settings.DefaultEnvironment.Flow.Speed);
|
||||
// Shader.SetGlobalFloat("_SafetyDistance", Settings.DefaultEnvironment.);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue