Edit i solved it ,
i had a problem with the collider
I keep this open for the problem with the StatsEquipableItem not moving to scenes
and weapons which are EquipableItem are moving fine
Another bug of ActionStore Duplicating while save and load from the game
Another bug of PickupSpawner if you take the items from one scene then go to the next scene
go back to scene that you took the items and Load the items come back
Everything is Solved
1.StatsEquipable Item - Wasnt inside Resource Folder ( make sure its in Resource Folder )
2.Action Store - Added Clear for the Dictionary see Below the code
3.Items coming back in Load with In the game - Changed in Portal.cs that it saves right before it destroy the portal see Below the code
4. Make sure your portals colliders arent interfering with the spawning point will make a loop that never ends and go crazy spawns in weird places
Code for stuff
2. Action Store
void ISaveable.RestoreState(object state)
{
dockedItems.Clear();
var stateDict = (Dictionary<int, DockedItemRecord>)state;
foreach (var pair in stateDict)
{
AddAction(InventoryItem.GetFromID(pair.Value.itemID), pair.Key, pair.Value.number);
}
}
3.Portal.cs updated
private IEnumerator Transition()
{
if (sceneToLoad <0)
{
Debug.LogError("Scene to load not set.");
yield break;
}
DontDestroyOnLoad(transform.root.gameObject);
Fader fader = FindObjectOfType<Fader>();
SavingWrapper savingWrapper = FindObjectOfType<SavingWrapper>();
PlayerController playerController = GameObject.FindWithTag("Player").GetComponent<PlayerController>();
playerController.enabled = false;
//Remove control player
yield return fader.FadeOut(fadeOutTime);
savingWrapper.Save();
yield return SceneManager.LoadSceneAsync(sceneToLoad);
PlayerController newPlayerController = GameObject.FindWithTag("Player").GetComponent<PlayerController>();
newPlayerController.enabled = false;
//Remove control player
savingWrapper.Load();
Portal otherPortal = GetOtherPortal();
UpdatePlayer(otherPortal);
yield return new WaitForSeconds(fadeWaitTime);
fader.FadeIn(fadeInTime);
//Restore control player
newPlayerController.enabled = true;
savingWrapper.Save();
Destroy(gameObject);
}