private void InitBases() { GameObject baseSpawn = GameObject.FindGameObjectWithTag("AllyBaseSpawn"); if (baseSpawn != null) { GameObject allyBaseObj = Instantiate(ResourcesData.GetObject(ResourcesData._bases, BasesEnum.BASE), baseSpawn.transform.position, baseSpawn.transform.rotation) as GameObject; _allyBaseManager = allyBaseObj.GetComponent <AllyBaseManager>(); _allyBaseManager.InitRobots(); } else { throw new System.Exception("Ally base spawn not found"); } baseSpawn = GameObject.FindGameObjectWithTag("EnnemyBaseSpawn"); if (baseSpawn != null) { GameObject ennemyBaseObj = Instantiate(ResourcesData.GetObject(ResourcesData._bases, BasesEnum.ENNEMYBASE), baseSpawn.transform.position, baseSpawn.transform.rotation) as GameObject; _ennemyBaseManager = ennemyBaseObj.GetComponent <EnnemyBaseManager>(); _ennemyBaseManager.InitRobots(); } else { throw new System.Exception("Ennemy base spawn not found"); } }
private bool isResourceExpireSoon(ResourcesData data, int counter, DataGridViewRow row) { int days = data.periodMonths * 30 + data.periodMonths / 2; if (data.difference > (counter * days) - 61 && data.difference < counter * days) { switch (data.type) { case Resources.WARRANTY: //row.Cells["warranty_exploit_period"].Style.BackColor = Color.Orange; break; case Resources.BEFORE: row.Cells["before_first_repair_period"].Style.BackColor = Color.Orange; break; case Resources.BETWEEN: row.Cells["between_repairs_period"].Style.BackColor = Color.OrangeRed; //межремонтный срок break; case Resources.ASSIGNED: row.Cells["assigned_period"].Style.BackColor = Color.Orange; break; } return(true); } return(false); }
/// <summary> /// 序列化资源数据 /// </summary> /// <param name="resPath"></param> /// <param name="isWriteExcel"></param> static void SerializeResInfo(string resPath, ref List <ResourcesData> infos) { string[] fileNames = Directory.GetFiles(resPath); string[] dirNames = Directory.GetDirectories(resPath); for (int i = 0; i < dirNames.Length; i++) { SerializeResInfo(dirNames[i], ref infos); } for (int i = 0; i < fileNames.Length; i++) { ResourcesData info = new ResourcesData(); if (PathUtils.GetExtension(fileNames[i]) != ".meta") { info.ID = FileUtils.GetFileMD5(fileNames[i]); info.Name = PathUtils.GetFileNameWithoutExtension(fileNames[i]); info.Path = PathUtils.GetRelativePathWithoutRootAndFileName("Resources", fileNames[i]); string assetPath = PathUtils.GetRelativePath("Assets", fileNames[i]); string[] dependencyPath = AssetDatabase.GetDependencies(assetPath); for (int j = 0; j < dependencyPath.Length; j++) { if (assetPath != dependencyPath[j]) { info.Dependencys.Add(PathUtils.GetFileNameWithoutExtension(dependencyPath[j])); } } info.version = ""; infos.Add(info); } } }
public void InitResources(ResourcesData resourcesData) { foreach (var resource in resourcesData.Resources) { Resources.Add(resource, 200); } }
// 다양화 : 싱글턴 종료될때 public override void OnFinalize() { TableData.OnFinalize(); ResourcesData.OnFinalize(); AssetBundleData.OnFinalize(); UserData.OnFinalize(); }
/// <summary> /// 把资源列表加入指定块中,并且返回需下载的资源列表. /// 保证如果存在块中,这个资源必然已经加载或者正在加载中. /// </summary> /// <param name="chunk">Chunk.</param> /// <param name="resArray">过滤后需要下载的列表</param> private void PushResources(ResourcesChunkData chunkData, ref List <string> resArray) { for (int i = resArray.Count - 1; i >= 0; i--) { if (!chunkData.resHash.Contains(resArray[i])) { int deleteIndex; // 如果有缓存不用加入 if (mCacheData.ContainsKey(resArray[i])) { mCacheData[resArray[i]].AddReference(); chunkData.resHash.Add(resArray[i]); resArray.RemoveAt(i); } else if (FindInDelete(resArray[i], out deleteIndex)) { ResourcesData data = ActivateDeleteCache(deleteIndex); data.AddReference(); mCacheData.Add(data.Name, data); chunkData.resHash.Add(resArray[i]); resArray.RemoveAt(i); } else { mCacheData.Add(resArray[i], new ResourcesData(resArray[i])); chunkData.resHash.Add(resArray[i]); } } else { resArray.RemoveAt(i); } } }
private ResourcesData ActivateDeleteCache(int index) { ResourcesData result = mDelete[index]; mDelete.RemoveAt(index); return(result); }
public void cacheSingeFinish(List <ResourcesData> _list) { resReady = true; if (_list == null || _list.Count < 1) { //找不到res里直接读取 if (ResourcesManager.Instance.allowLoadFromRes) { foreach (Object each in callbackDic.Keys) { resourcesLoadTexture(each); } } return; } if (_list [0].ResourcesBundle == null) { return; } data = _list [0]; foreach (Object each in callbackDic.Keys) { pushTexture(each); } callbackDic.Clear(); TextureManager.instance.clear(); }
protected override void InitRobot() { _robotObj = Instantiate(ResourcesData.GetObject(ResourcesData._robots, RobotsEnum.ENNEMYROBOT), transform) as GameObject; _robotObj.SetActive(false); SetDestination(GameManager.Singleton.GetClosestResource(transform.position).gameObject); }
public void releaseResourcesData() { if (useResData != null && ResourcesManager.Instance != null) { ResourcesManager.Instance.UnloadAssetUIBundleBlock(useResData.ResourcesName); useResData = null; } }
public void clean() { pointData = null; resourcesData = null; pointList = null; pointRoot = null; drawPoint = null; }
// ReSharper disable once UnusedMember.Global public IEnumerator SetUp() { TestSettings = Common.LoadTestSettings(); TerrainSettings = ResourcesData.LoadTerrainSettings(); TerrainCreator = InitTerrainCreator(); SetUpAdditional(); yield return(null); }
private void TakeAwayResourcesRoad(Road road) { for (int i = 0; i < _amountNeedResource; i++) { ResourceForConstruction resource = road.ResourcesForConstruction[i]; ResourcesData needRecource = _resources.resourcesData[_resources.FindIndexResourceInList(resource.ResourceType)]; needRecource.ChangeAmountResource.Invoke(resource.ResourceType, -resource.CostConstruction); } }
private void TakeAwayResources(Building building) { for (int i = 0; i < _amountNeedResource; i++) { ResourceForConstruction resource = building.LevelsData[building.CurrentLevel].resourcesForConstruction[i]; ResourcesData needRecource = _resources.resourcesData[_resources.FindIndexResourceInList(resource.ResourceType)]; needRecource.ChangeAmountResource.Invoke(resource.ResourceType, -resource.CostConstruction); } }
private static ResourcesData CreateResourcesData(Type type, Object obj) { ResourcesData ret = cached_resource_datas.Count > 0 ? cached_resource_datas.Dequeue() : new ResourcesData(); ret.type = type; ret.obj = obj; ret.refCount = 0; return(ret); }
public void resolveConfigTextAsset(ResourcesData rd, string name) { TextAsset ta = rd.ResourcesBundle.Load(name) as TextAsset; if (ta == null) { return; } resolveConfig(ta.text); }
// 다양화 : 싱글턴 생성될때 public override void OnInitialize() { TableData.OnInitialize(); ResourcesData.OnInitialize(); AssetBundleData.OnInitialize(); ServerData.OnInitialize(); UserData.OnInitialize(); SetDontDestroy(); }
// 시스템 : 업데이트 public override void FixedUpdate() { base.FixedUpdate(); TableData.FrameMove(); ResourcesData.FrameMove(); AssetBundleData.FrameMove(); ServerData.FrameMove(); UserData.FrameMove(); }
private void InitResourceNodes() { GameObject[] resourcesArr = GameObject.FindGameObjectsWithTag("ResourceNode"); GameObject resourceObj = ResourcesData.GetObject(ResourcesData._resources, ResourcesEnum.RESOURCE) as GameObject; foreach (var resource in resourcesArr) { _lResources.Add(Instantiate(resourceObj, resource.transform.position, resource.transform.rotation).GetComponent <NodeResourceManagement>()); } }
// 유틸 : 로드 리스트 List <Dictionary <string, SHLoadData> > GetLoadList(eSceneType eType) { var pLoadList = new List <Dictionary <string, SHLoadData> >(); pLoadList.Add(ServerData.GetLoadList(eType)); pLoadList.Add(TableData.GetLoadList(eType)); pLoadList.Add(ResourcesData.GetLoadList(eType)); pLoadList.Add(AssetBundleData.GetLoadList(eType)); return(pLoadList); }
// 유틸 : 패치 리스트 List <Dictionary <string, SHLoadData> > GetPatchList() { var pPatchList = new List <Dictionary <string, SHLoadData> >(); pPatchList.Add(ServerData.GetPatchList()); pPatchList.Add(TableData.GetPatchList()); pPatchList.Add(ResourcesData.GetPatchList()); pPatchList.Add(AssetBundleData.GetPatchList()); return(pPatchList); }
private void SendUpdateSignal() { var resources = new ResourcesData() { Gold = Gold, Steel = Steel, Wood = Wood }; signalBus.Publish <UpdateResourcesSignal>(new UpdateResourcesSignal(resources)); }
public GameObject SpawnBulletHole(Vector3 position, NetworkHash128 assetId) { GameObject bulletHole = GetBulletHole(position); if (bulletHole != null) { return(bulletHole); } Transform bulletHolesParent = transform.Find("BulletHoles"); return(Instantiate(ResourcesData.GetObject(ResourcesData._fx, FxEnum.BULLETHOLE), Vector3.zero, Quaternion.identity, bulletHolesParent) as GameObject); }
private void OnLoaded1(LoadingData loadingData, Object obj, int count) { if (obj == null) { Debug.LogErrorFormat("[ResourcesHolder] Fail to load file '{0}' !", HashString.GetString(loadingData.key)); return; } ResourcesData data = CreateResourcesData(loadingData.type, obj); data.refCount = count; mLoaded.Add(loadingData.key, data); mResourcesToPath.Add(GetResourcesKey(loadingData.type, obj), loadingData.key); }
// Update is called once per frame void Update() { if (_PV <= 0 && _alive) { _alive = false; _navAgent.isStopped = true; _navAgent.enabled = false; GetComponent <Collider>().enabled = false; transform.rotation = Quaternion.Euler(new Vector3(90, transform.rotation.eulerAngles.y, transform.rotation.eulerAngles.z)); transform.position = new Vector3(transform.position.x, 0, transform.position.z); Instantiate(ResourcesData.GetObject(ResourcesData._fx, FxEnum.SMOKE), transform.position, Quaternion.identity); } }
//卸载指定镜像 public void UnloadAssetBundleBlock (ResourcesData path, bool forceRemove, string key) { if (allDataList.ContainsKey (key)) { Dictionary<string,ResourcesData> dic = allDataList [key]; if (dic.ContainsKey (path.ResourcesName)) { float size = dic [path.ResourcesName].size; dic [path.ResourcesName].ResourcesBundle.Unload (forceRemove); dic.Remove (path.ResourcesName); changeSize (key, -size); } clean (); } }
void Start() { ggm = GlobalGameManager.instance; resourcesData = GameObject.Find("GlobalGameManager/ResourcesData").GetComponent <ResourcesData>(); completionRewards = GameObject.Find("GlobalGameManager/LevelData/Completion").GetComponent <RewardGroup>(); firstTimeRewards = GameObject.Find("GlobalGameManager/LevelData/FirstTime").GetComponent <RewardGroup>(); masteryRewards = GameObject.Find("GlobalGameManager/LevelData/Mastery").GetComponent <RewardGroup>(); scoreMarks = ggm.GetScoreMarks(); levelName = ggm.GetLevelName(); PopulateRewards(completionRewards, rewardContentC, "Completion", 1); PopulateRewards(firstTimeRewards, rewardContentFT, "First Time", 1); PopulateRewards(masteryRewards, rewardContentM, "Mastery", 1); }
public async Task Load() { var loadingView = (ILoadingView)(await windowNavigation.Show <ILoadingView>(CancellationToken.None)); loadingView.UpdateProgress(null); resourcesData = await resourcesDataProvider.GetData(); player.InitResources(resourcesData); currentGame = await gameLoader.LoadGame(1, CancellationToken.None); _ = windowNavigation.Hide <ILoadingView>(CancellationToken.None); }
public void Initialize() { charSave = ScriptableObject.CreateInstance(typeof(CharactersSave)) as CharactersSave; charSave.LoadData(); resourcesData = ScriptableObject.CreateInstance(typeof(ResourcesData)) as ResourcesData; foreach (var temp in managers) { temp.Initialize(); } Status = ManagerStatus.Online; status = ManagerStatus.Online; }
private void PlayGoddessMusic(int id) { if (ResourcesManager.Instance.allowLoadFromRes) { audioSource.clip = Resources.Load("audio/audio_" + id, typeof(AudioClip)) as AudioClip; audioSource.Play(); audioSource.volume = 1f; } else { ResourcesData data = ResourcesManager.Instance.getResource("audio/audio_" + id); audioSource.clip = data.ResourcesBundle.mainAsset as AudioClip; audioSource.Play(); audioSource.volume = 1f; } }