From 6c74173cb1e88ea5533dcd39edfcfb582aa55f19 Mon Sep 17 00:00:00 2001 From: uurha Date: Thu, 25 Jul 2024 17:19:54 +0000 Subject: [PATCH] Merge pull request #23 from techno-dwarf-works/feature/refactoring Version 0.1.16 --- Runtime/Modules/CacheModule.cs | 5 +++++ package.json | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Runtime/Modules/CacheModule.cs b/Runtime/Modules/CacheModule.cs index b3f5a77..e8aece7 100644 --- a/Runtime/Modules/CacheModule.cs +++ b/Runtime/Modules/CacheModule.cs @@ -34,6 +34,11 @@ public void CacheState(TState state) return; } + if (_stateLocator.ContainsElement(state)) + { + return; + } + var type = state.GetType(); _stateLocator.Remove(type); _stateLocator.Add(type, state); diff --git a/package.json b/package.json index 1d44ba0..1292370 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "com.tdw.better.statemachine", "displayName": "Better State Machine", - "version": "0.1.15", + "version": "0.1.16", "unity": "2021.3", "description": " ", "dependencies": { "com.tdw.better.internal.core": "0.0.2", - "com.tdw.better.commons": "0.0.22", + "com.tdw.better.commons": "0.0.26", "com.tdw.better.locators": "0.1.12", "com.tdw.better.conditions": "0.0.3" },