using System.Collections.Generic; using UnityEngine; namespace SLZ.Marrow.Warehouse { public class SurfaceDataCard : DataCard { [Header("Options")] [Range(.001f, 1f)] public float PenetrationResistance = 0.9f; public float megaPascal = 100f; [SerializeField] private MarrowAssetT _physicsMaterial; public MarrowAssetT PhysicsMaterial { get => _physicsMaterial; set => _physicsMaterial = value; } [SerializeField] private MarrowAssetT _physicsMaterialStatic; public MarrowAssetT PhysicsMaterialStatic { get => _physicsMaterialStatic; set => _physicsMaterialStatic = value; } public override bool IsBundledDataCard() { return true; } public override void ImportPackedAssets(Dictionary packedAssets) { base.ImportPackedAssets(packedAssets); if (packedAssets.TryGetValue("PhysicsMaterial", out var packedAsset)) PhysicsMaterial = new MarrowAssetT(packedAsset.marrowAsset.AssetGUID); if (packedAssets.TryGetValue("PhysicsMaterialStatic", out packedAsset)) PhysicsMaterialStatic = new MarrowAssetT(packedAsset.marrowAsset.AssetGUID); #if false #endif } public override List ExportPackedAssets() { base.ExportPackedAssets(); PackedAssets.Add(new PackedAsset("PhysicsMaterial", PhysicsMaterial, PhysicsMaterial.AssetType, "_physicsMaterial")); PackedAssets.Add(new PackedAsset("PhysicsMaterialStatic", PhysicsMaterialStatic, PhysicsMaterialStatic.AssetType, "_physicsMaterialStatic")); #if false #endif return PackedAssets; } } }