Browse Source

Added child UiAnimators

jamesperet 2 years ago
parent
commit
eaff103af5
3 changed files with 10 additions and 3 deletions
  1. 1 1
      Readme.md
  2. 7 0
      Runtime/UiAnimator.cs
  3. 2 2
      package.json

+ 1 - 1
Readme.md

@@ -1,4 +1,4 @@
-# 📦 KairoEngine.UI.v0.1.5
+# 📦 KairoEngine.UI.v0.1.6
 
 The **UI** package contains the ``UiSystem`` component and the ``UiSystemModule``. The module loads the Ui System in place which manages canvases with UI data. The system now which canvases are enabled and has a global toggle for all the game UI.
 

+ 7 - 0
Runtime/UiAnimator.cs

@@ -21,6 +21,9 @@ namespace KairoEngine.UI
         
         [BoxGroup("Settings"), ShowIf("@animateOnDisable")] public bool disableObjectOnEnd = true;
 
+        [Tooltip("The UiAnimators on this list will be triggered when this animator is enabled or disabled")]
+        [BoxGroup("Settings")] public List<UiAnimator> childUiAnimators = new List<UiAnimator>();
+
         [FoldoutGroup("Scale")] public bool animateScale = true;
         [FoldoutGroup("Scale"), ShowIf(@"animateScale")] public float scaleDuration = 0.3f;
         [FoldoutGroup("Scale"), ShowIf(@"animateScale")] public Vector3 sacelFrom;
@@ -31,6 +34,8 @@ namespace KairoEngine.UI
         [FoldoutGroup("Alpha"), ShowIf(@"animateAlpha")] public float alphaFrom = 0f;
         [FoldoutGroup("Alpha"), ShowIf(@"animateAlpha")] public float alphaTo = 1f;
 
+        
+
         private LTDescr _tweenObject = new LTDescr();
 
         private bool showing = true;
@@ -51,6 +56,7 @@ namespace KairoEngine.UI
                 cancelDisable = true;
                 Animate();
             }
+            for (int i = 0; i < childUiAnimators.Count; i++) childUiAnimators[i].Enable();
         }
 
         public void Disable()
@@ -73,6 +79,7 @@ namespace KairoEngine.UI
                     else if(this != null) gameObject.SetActive(false);
                 }
             });
+            for (int i = 0; i < childUiAnimators.Count; i++) childUiAnimators[i].Disable();
             // _tweenObject.setDelay(disableDelay).setOnComplete(() => {
             //     SwapDirection();
             //     if(disableObjectOnEnd && !cancelDisable) 

+ 2 - 2
package.json

@@ -1,7 +1,7 @@
 {
     "name": "at.kairoscope.kairoengine.ui",
     "displayName" : "KairoEngine UI",
-    "version": "0.1.5",
+    "version": "0.1.6",
     "unity": "2020.3",
     "description": "User Interface library for kairoEngine",
     "repository": {
@@ -10,7 +10,7 @@
     },
     "author": "Kairoscope",
     "dependencies": {
-      "at.kairoscope.kairoengine.core":"0.1.6",
+      "at.kairoscope.kairoengine.core":"0.1.9",
       "at.kairoscope.kairoengine.sfx":"0.1.3",
       "at.kairoscope.thirdparty.leantween":"1.0.0",
       "at.kairoscope.thirdparty.tmpro":"1.0.0"