Skip to content

Commit

Permalink
Axie LV2
Browse files Browse the repository at this point in the history
  • Loading branch information
phuong-axie committed Feb 22, 2024
1 parent 0c38faf commit ad1784f
Show file tree
Hide file tree
Showing 22 changed files with 63,596 additions and 33,310 deletions.
Binary file not shown.
2 changes: 1 addition & 1 deletion [email protected][email protected]

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using AxieCore.AxieMixer;
using Spine.Unity;
using UnityEngine;
Expand Down Expand Up @@ -34,6 +33,33 @@ public int GetSampleColorVariant(AxieCore.AxieMixer.CharacterClass characterClas

public Axie2dBuilderResult BuildSpineAdultCombo(Dictionary<string, string> adultCombo, byte colorVariant, float scale, bool isGraphic = false)
{
if (adultCombo.ContainsKey("back.lv2"))
{
adultCombo["back"] = adultCombo["back"].Replace("-lv2", "") + "-lv2";
}
if (adultCombo.ContainsKey("ears.lv2"))
{
adultCombo["ears"] = adultCombo["ears"].Replace("-lv2", "") + "-lv2";
adultCombo["ear"] = adultCombo["ear"].Replace("-lv2", "") + "-lv2";
}
if (adultCombo.ContainsKey("eyes.lv2"))
{
adultCombo["eyes"] = adultCombo["eyes"].Replace("-lv2", "") + "-lv2";
}
if (adultCombo.ContainsKey("horn.lv2"))
{
adultCombo["horn"] = adultCombo["horn"].Replace("-lv2", "") + "-lv2";
}
if (adultCombo.ContainsKey("mouth.lv2"))
{
adultCombo["mouth"] = adultCombo["mouth"].Replace("-lv2", "") + "-lv2";
}

if (adultCombo.ContainsKey("tail.lv2"))
{
adultCombo["tail"] = adultCombo["tail"].Replace("-lv2", "") + "-lv2";
}

var accessories = adultCombo.Where(x => x.Key.StartsWith("accessory-")).ToList();
foreach(var p in accessories)
{
Expand Down Expand Up @@ -113,6 +139,8 @@ public Axie2dBuilderResult BuildSpineFromGene(string axieId, AxieBodyStructure b
adultCombo.Add(p.Key, p.Value);
}
}


byte colorVariant = (byte)axieGenesStuff.GetAxieColorVariant(bodyStructure);

return BuildSpineAdultCombo(adultCombo, colorVariant, scale, isGraphic);
Expand All @@ -137,12 +165,7 @@ SkeletonDataAsset CreateMixedSkeletonDataAsset(MixedSkeletonData mixed, float sc
Scale = scale
};
var loadedSkeletonData = skeletonMixed.ReadSkeletonData(mixed, true);

//phuongnk - cheat to call internal function
skeletonDataAsset.skeletonJSON = new TextAsset();
Type thisType = skeletonDataAsset.GetType();
var theMethod = thisType.GetMethod("InitializeWithData", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
theMethod.Invoke(skeletonDataAsset, new object[] { loadedSkeletonData });
skeletonDataAsset.InitializeWithData(loadedSkeletonData);

return skeletonDataAsset;
}
Expand Down
8 changes: 8 additions & 0 deletions Assets/AxieInfinity/AxieMixerUnity/Resources/Sprites.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ad1784f

Please sign in to comment.