Skip to content

Commit 4f413e6

Browse files
committed
2.3.0 Merge
2 parents a0b18c4 + d710d51 commit 4f413e6

File tree

7 files changed

+59
-9
lines changed

7 files changed

+59
-9
lines changed

Editor/Code/VarianceAPI.Editor.asmdef

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,21 @@
1919
"Assembly-CSharp.dll"
2020
],
2121
"autoReferenced": true,
22-
"defineConstraints": [],
23-
"versionDefines": [],
22+
"defineConstraints": [
23+
"VAPI_GAME_IMPORTED",
24+
"VAPI_MSU_IN_PROJECT"
25+
],
26+
"versionDefines": [
27+
{
28+
"name": "riskofrain2",
29+
"expression": "0.0.1",
30+
"define": "VAPI_GAME_IMPORTED"
31+
},
32+
{
33+
"name": "teammoonstorm-moonstormsharedutils",
34+
"expression": "2.3.0",
35+
"define": "VAPI_MSU_IN_PROJECT"
36+
}
37+
],
2438
"noEngineReferences": false
2539
}

Runtime/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# '2.3.0' - Memory Optimization
2+
3+
* Updated to game version 1.3.9
4+
* AssemblyDef for Runtime and Editor will no longer load if no game or MSU is installed in the project
5+
16
# '2.2.0' - Variants of the Storm
27

38
* Updated to unity 2021.3.33

Runtime/Code/Components/BodyVariantManager.cs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public class BodyVariantManager : NetworkBehaviour
4848
private bool hasApplied = false;
4949
private EquipmentIndex storedEquip;
5050
private ItemDisplayRuleSet storedIDRS;
51+
private bool modelSkinControllerFinished;
5152

5253
#region Networking Related
5354
/// <summary>
@@ -76,13 +77,26 @@ private void OnListChanged(SyncList<int>.Operation op, int index)
7677

7778
private void Awake()
7879
{
79-
variantIndices.Callback = OnListChanged;
80-
8180
characterBody = GetComponent<CharacterBody>();
8281
characterDeathBehavior = GetComponent<CharacterDeathBehavior>();
8382

8483
if (characterBody.modelLocator && characterBody.modelLocator.modelTransform)
8584
characterModel = characterBody.modelLocator.modelTransform.GetComponent<CharacterModel>();
85+
86+
if(characterModel.TryGetComponent<ModelSkinController>(out var mdlSkinController))
87+
{
88+
mdlSkinController.onSkinApplied += onSkinApplied;
89+
}
90+
else
91+
{
92+
modelSkinControllerFinished = true;
93+
}
94+
variantIndices.Callback = OnListChanged;
95+
}
96+
97+
private void onSkinApplied(int obj)
98+
{
99+
modelSkinControllerFinished = true;
86100
}
87101

88102
private void Start()
@@ -194,6 +208,9 @@ public void Apply()
194208
private IEnumerator ApplyVisuals()
195209
{
196210
yield return new WaitForEndOfFrame();
211+
while (!modelSkinControllerFinished)
212+
yield return new WaitForEndOfFrame();
213+
197214
foreach (VariantVisuals visuals in visualsForCoroutine)
198215
{
199216
visuals.ApplyMaterials(characterModel);

Runtime/Code/VAPIMain.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class VAPIMain : BaseUnityPlugin
3131
/// <summary>
3232
/// VAPI's Version
3333
/// </summary>
34-
public const string VERSION = "2.2.0";
34+
public const string VERSION = "2.3.0";
3535

3636
/// <summary>
3737
/// The instancee class of the Main class

Runtime/Code/VarianceAPI.asmdef

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,21 @@
4545
"R2API.Addressables.dll"
4646
],
4747
"autoReferenced": true,
48-
"defineConstraints": [],
49-
"versionDefines": [],
48+
"defineConstraints": [
49+
"VAPI_GAME_IMPORTED",
50+
"VAPI_MSU_IN_PROJECT"
51+
],
52+
"versionDefines": [
53+
{
54+
"name": "riskofrain2",
55+
"expression": "0.0.1",
56+
"define": "VAPI_GAME_IMPORTED"
57+
},
58+
{
59+
"name": "teammoonstorm-moonstormsharedutils",
60+
"expression": "2.3.0",
61+
"define": "VAPI_MSU_IN_PROJECT"
62+
}
63+
],
5064
"noEngineReferences": false
5165
}

Runtime/VAPI-Manifest.asset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ MonoBehaviour:
9393
Name: VarianceAPI
9494
Description: VarianceAPI allows you to create Variants for CharacterBodies, Variants
9595
can have different textures, lights, skills, and more.
96-
Version: 2.2.0
96+
Version: 2.3.0
9797
Dependencies:
9898
- {fileID: 11400000, guid: 5ceb1d8ed3af40d4d806e9756b403649, type: 2}
9999
- {fileID: 11400000, guid: 613d4ca030e90a832defdb35afe5393b, type: 2}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"url": ""
77
},
88
"displayName": "VarianceAPI",
9-
"version": "2.2.0",
9+
"version": "2.3.0",
1010
"unity": "2021.3",
1111
"description": "An API for Risk of Rain 2 that allows the creation of \"Variants\" for CharacterBodies, variants can have different skills, skins, models and more."
1212
}

0 commit comments

Comments
 (0)