public OSLibObject(int id, string type, string brand, string thumbnail, OSLib library, OSLibModel model, OSLibModules modules, OSLibCategory cat, bool mode2d, bool allowscale, int ScaleGenerale) { _id = id; _type = type; _brand = brand; _thumbnailPath = thumbnail; _library = library; _model = model; _modules = modules; _categorie = cat; _mode2d = mode2d; _allowscale = allowscale; _ScaleGenerale = ScaleGenerale; }
public void SetModel(OSLibModel model) { _model = model; }
public IEnumerator SwapPool(int gizmoIndex, int stairIndex) { if (gizmoIndex >= _gizmos.Count) { yield return null; } ObjData objData = GetComponent<ObjData> (); OSLibObject objModel = objData.GetObjectModel (); Montage.assetBundleLock = true; OSLib objLib = objModel.GetLibrary (); WWW www = WWW.LoadFromCacheOrDownload (objLib.GetAssetBundlePath (), objLib.GetVersion ()); yield return www; AssetBundle assetBundle = www.assetBundle; int newStairIndex = stairIndex; string stairName = ""; string path = ""; int newGizmoIndex = gizmoIndex; if (stairIndex < 0) { newStairIndex = -1; path = objModel.GetModel ().GetBasePath (); } else { stairName = _stairList.GetStairList ()[stairIndex].GetStairType (); string baseModelPath = objModel.GetModel ().GetBasePath (); path = baseModelPath + "_" + stairName + "_" + (gizmoIndex + 1); bool exist = assetBundle.Contains (path); if (!exist) { newGizmoIndex = FindFirstGizmoAvailable (assetBundle, stairName); if (newGizmoIndex < 0) { path = baseModelPath; } else { path = baseModelPath + "_" + stairName + "_" + (newGizmoIndex + 1); } } } assetBundle.Unload (false); Montage.assetBundleLock = false; _selectedGizmoIndex = newGizmoIndex; _selectedStairIndex = newStairIndex; OSLibModel poolStairModel = new OSLibModel (path, objModel.GetModel ().GetBasePath ()); OSLibObject poolStairObject = new OSLibObject (objModel.GetId (), objModel.GetObjectType (), objModel.GetBrand (), objModel.GetThumbnailPath (), objModel.GetLibrary (), poolStairModel, objModel.GetModules (), objModel.getCategory (), objModel.IsMode2D (), objModel.IsAllowedToScale (), objModel.GetObjectScaleGenerale()); poolStairObject.SetLanguages (objModel); Camera.main.GetComponent<ObjInteraction>().setSelected (gameObject, true); ObjInstanciation instantiator = GameObject.Find("MainNode").GetComponent<ObjInstanciation> (); yield return StartCoroutine (instantiator.swap (transform.position, poolStairObject, gameObject, -1, -1, -1)); }