cz.xprees.variables 1.0.9 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -49,6 +49,13 @@ namespace Xprees.Variables.Base
49
49
 
50
50
  public static implicit operator T(ReferenceBase<T> reference) => reference != null ? reference.Value : default;
51
51
 
52
+ public virtual void BackupStartState()
53
+ {
54
+ if (!useInlined) return; // Variables does that by themselves
55
+
56
+ _defaultInlinedValue = inlinedValue;
57
+ }
58
+
52
59
  public virtual void ResetState()
53
60
  {
54
61
  if (useInlined)
@@ -57,7 +64,7 @@ namespace Xprees.Variables.Base
57
64
  return;
58
65
  }
59
66
 
60
- variable.ResetState();
67
+ variable?.ResetState();
61
68
  }
62
69
  }
63
70
  }
@@ -21,5 +21,16 @@ namespace Xprees.Variables.Base
21
21
  }
22
22
 
23
23
  protected abstract T AggregateValue(VariableBaseSO<T>[] variableBases);
24
+
25
+ public override void ResetState()
26
+ {
27
+ base.ResetState();
28
+ if (variables == null) return;
29
+
30
+ foreach (var variable in variables)
31
+ {
32
+ variable?.ResetState();
33
+ }
34
+ }
24
35
  }
25
36
  }
@@ -15,6 +15,7 @@ namespace Xprees.Variables.Base
15
15
  private void OnEnable()
16
16
  {
17
17
  hideFlags = HideFlags.DontUnloadUnusedAsset;
18
+ disableWrite?.BackupStartState();
18
19
  ResetState();
19
20
  }
20
21
 
@@ -29,5 +30,12 @@ namespace Xprees.Variables.Base
29
30
  }
30
31
 
31
32
  protected abstract T ModifyValue(T value);
33
+
34
+ public override void ResetState()
35
+ {
36
+ base.ResetState();
37
+ variable?.ResetState();
38
+ disableWrite?.ResetState();
39
+ }
32
40
  }
33
41
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cz.xprees.variables",
3
3
  "displayName": "Variables",
4
- "version": "1.0.9",
4
+ "version": "1.0.11",
5
5
  "unity": "2021.3",
6
6
  "description": "This package contains a system for creating variables based on ScriptableObjects in Editor.",
7
7
  "license": "MIT",
@@ -1,31 +0,0 @@
1
- name: Publish to NPM registry
2
-
3
- on:
4
- push:
5
- branches:
6
- - master
7
- - release/*
8
-
9
- jobs:
10
- publish-gpr:
11
- runs-on: ubuntu-latest
12
- permissions:
13
- contents: read
14
- packages: write
15
- environment: Production
16
- steps:
17
- - uses: actions/checkout@v4
18
- - uses: actions/setup-node@v4
19
- with:
20
- node-version: 20
21
- - name: Version Patcher
22
- uses: justalemon/VersionPatcher@v0.8
23
- with:
24
- version: 1.0.${{ github.run_number }}
25
- npm-files: 'package.json'
26
- - uses: JS-DevTools/npm-publish@v3
27
- with:
28
- token: ${{ secrets.NPM_AUTH_TOKEN }}
29
- access: public
30
- ignore-scripts: true
31
-