public override void Init(JediumBehaviourSnapshot snapshot) { base.Init(snapshot); defaultUIPath = Path.Combine(Application.persistentDataPath, "UI"); if (snapshot.BehaviourType != "UI") { return; } JediumUISnapshot t = (JediumUISnapshot)snapshot; this.dllName = t.dllName; this.bundleId = t.bundleId; this.xamlName = t.xamlName; this.archiveName = t.archiveName; xamlPath = String.Empty; //check if base path exists if (!Directory.Exists(defaultUIPath)) { Debug.Log("___CREATING UI PATH:" + defaultUIPath); Directory.CreateDirectory(defaultUIPath); } // string localPath = Path.Combine(Application.dataPath, "Resources", xamlName); string localPath = Path.Combine(defaultUIPath, xamlName); Debug.Log("___PATH 1:" + localPath); if (LoadXamlFromBundle(localPath)) { xamlPath = Path.ChangeExtension(localPath, ".xaml"); } Debug.Log("___PATH 2:" + xamlPath); // string archivePath = Path.Combine(Application.dataPath, "Resources", archiveName); string archivePath = Path.Combine(defaultUIPath, archiveName); string changedArchiveName = Path.ChangeExtension(archivePath, ".zip"); Debug.Log("___PATH 3:" + changedArchiveName); LoadArchive(Path.Combine(changedArchiveName)); Debug.Log("___Init"); BindDependencies(); }
public override void FromSnapshot(JediumBehaviourSnapshot snap) { if (snap.GetBehaviourType() != "UI") { Log.Warn($"Wrong snapshot type: {snap.GetBehaviourType()}"); } JediumUISnapshot UISnap = (JediumUISnapshot)snap; this.dllName = UISnap.dllName; this._bundleId = UISnap.bundleId; this.xamlName = UISnap.xamlName; this.archiveName = UISnap.archiveName; }