Skip to content

Commit

Permalink
Merge pull request #39 from T-Kuhn/update-to-v0.39.1
Browse files Browse the repository at this point in the history
update to v0.39.1
  • Loading branch information
T-Kuhn authored Jan 12, 2023
2 parents 39cf944 + 22bfd95 commit fbf1d41
Show file tree
Hide file tree
Showing 151 changed files with 3,096 additions and 1,625 deletions.
61 changes: 60 additions & 1 deletion Assets/Effekseer/Editor/EffekseerAssetPostProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static void OnPostprocessAllAssets(
EffekseerMaterialAsset.ImportingAsset importingAsset = new EffekseerMaterialAsset.ImportingAsset();
importingAsset.Data = System.IO.File.ReadAllBytes(assetPath);
importingAsset.UserTextureSlotMax = EffekseerTool.Constant.UserTextureSlotCount;
var info = new EffekseerTool.Utl.MaterialInformation();
var info = new Effekseer.Editor.Utils.MaterialInformation();
info.Load(System.IO.Path.Combine(System.IO.Directory.GetCurrentDirectory(), assetPath));

importingAsset.CustomData1Count = info.CustomData1Count;
Expand All @@ -95,9 +95,68 @@ static void OnPostprocessAllAssets(
importingAsset.Textures.Add(tp);
}

// TODO : Refactor
foreach (var g in info.FixedGradients)
{
var gp = new EffekseerMaterialAsset.GradientProperty();
gp.Name = g.Name;
gp.UniformName = g.UniformName;

gp.ColorMarkers = new EffekseerMaterialAsset.GradientProperty.ColorMarker[g.Data.ColorMarkers.Length];
for (int i = 0; i < g.Data.ColorMarkers.Length; i++)
{
gp.ColorMarkers[i].ColorR = g.Data.ColorMarkers[i].ColorR;
gp.ColorMarkers[i].ColorG = g.Data.ColorMarkers[i].ColorG;
gp.ColorMarkers[i].ColorB = g.Data.ColorMarkers[i].ColorB;
gp.ColorMarkers[i].Intensity = g.Data.ColorMarkers[i].Intensity;
gp.ColorMarkers[i].Position = g.Data.ColorMarkers[i].Position;
}

gp.AlphaMarkers = new EffekseerMaterialAsset.GradientProperty.AlphaMarker[g.Data.AlphaMarkers.Length];
for (int i = 0; i < g.Data.AlphaMarkers.Length; i++)
{
gp.AlphaMarkers[i].Alpha = g.Data.AlphaMarkers[i].Alpha;
gp.AlphaMarkers[i].Position = g.Data.AlphaMarkers[i].Position;
}

importingAsset.FixedGradients.Add(gp);
}

foreach (var g in info.Gradients)
{
var gp = new EffekseerMaterialAsset.GradientProperty();
gp.Name = g.Name;
gp.UniformName = g.UniformName;

gp.ColorMarkers = new EffekseerMaterialAsset.GradientProperty.ColorMarker[g.Data.ColorMarkers.Length];
for (int i = 0; i < g.Data.ColorMarkers.Length; i++)
{
gp.ColorMarkers[i].ColorR = g.Data.ColorMarkers[i].ColorR;
gp.ColorMarkers[i].ColorG = g.Data.ColorMarkers[i].ColorG;
gp.ColorMarkers[i].ColorB = g.Data.ColorMarkers[i].ColorB;
gp.ColorMarkers[i].Intensity = g.Data.ColorMarkers[i].Intensity;
gp.ColorMarkers[i].Position = g.Data.ColorMarkers[i].Position;
}

gp.AlphaMarkers = new EffekseerMaterialAsset.GradientProperty.AlphaMarker[g.Data.AlphaMarkers.Length];
for (int i = 0; i < g.Data.AlphaMarkers.Length; i++)
{
gp.AlphaMarkers[i].Alpha = g.Data.AlphaMarkers[i].Alpha;
gp.AlphaMarkers[i].Position = g.Data.AlphaMarkers[i].Position;
}

importingAsset.Gradients.Add(gp);
}

importingAsset.IsCacheFile = false;
importingAsset.Code = info.Code;

importingAsset.MaterialRequiredFunctionTypes = new EffekseerMaterialAsset.MaterialRequiredFunctionType[info.RequiredFunctionTypes.Length];
for (int i = 0; i < importingAsset.MaterialRequiredFunctionTypes.Length; i++)
{
importingAsset.MaterialRequiredFunctionTypes[i] = (EffekseerMaterialAsset.MaterialRequiredFunctionType)info.RequiredFunctionTypes[i];
}

EffekseerMaterialAsset.CreateAsset(assetPath, importingAsset);
}
if (Path.GetExtension(assetPath) == ".efkmatd")
Expand Down
21 changes: 21 additions & 0 deletions Assets/Effekseer/Editor/EffekseerEmitterEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,27 @@ void CallSceneGUI()
emitter.speed = Mathf.Clamp(emitter.speed, 0, 2);
GUILayout.EndHorizontal();

GUILayout.BeginHorizontal();
GUILayout.Label("Trigger", GUILayout.Width(50));
if (GUILayout.Button("0"))
{
emitter.SendTrigger(0);
}
if (GUILayout.Button("1"))
{
emitter.SendTrigger(1);
}
if (GUILayout.Button("2"))
{
emitter.SendTrigger(2);
}
if (GUILayout.Button("3"))
{
emitter.SendTrigger(3);
}
GUILayout.EndHorizontal();


GUILayout.BeginHorizontal();
GUILayout.Label("Instance", GUILayout.Width(80));
GUILayout.Label(emitter.instanceCount.ToString());
Expand Down
Loading

0 comments on commit fbf1d41

Please sign in to comment.