GameObject GetResource(int resrouce_id) { MapResourceProxy res = MapResourceCenter.GetResource(resrouce_id); resources.Add(res); return(res.resource); }
public void Show(int l) { if (level == l) { return; } level = l; if (res != null) { res.Release(); res = null; } if (resource[level] == 0) { return; } this.gameObject.SetActive(true); res = MapResourceCenter.GetResource(resource[level]); res.resource.transform.localPosition = Vector3.zero; res.resource.transform.localScale = Vector3.one * 0.01f; res.resource.transform.Rotate(new Vector3(0, Random.Range(0, 360), 0)); res.resource.transform.SetParent(this.transform, false); res.resource.SetActive(true); }
public void Spawn(int res_obj_id, Vector3 pos) { MapResourceProxy res = MapResourceCenter.GetResource(res_obj_id); MapLODObject obj = res.resource.GetComponent <MapLODObject>(); obj.transform.position = pos; if (obj.resource[2] != 0) { obj.p = high_obj_list.AddLast(obj); } else { obj.p = obj_list.AddLast(obj); } }