private GameObject GetGameObject(Vector3 pos) { GameObject g = PD.GetBankObject(); if (g == null) { g = Instantiate(PD.universalPrefab, pos, Quaternion.identity) as GameObject; } else { g.transform.position = pos; } return(g); }
protected GameObject GetGameObject_Tile(Vector3 pos, string name, Sprite sprite, string sortLayer) { GameObject g = PD.GetBankObject(); if (g == null) { return(GetGameObject(pos, name, sprite, collider, sortLayer)); } SpriteRenderer g_sr = g.GetComponent <SpriteRenderer>(); g.transform.localScale = new Vector3(1.0f, 1.0f, 1.0f); g_sr.color = Color.white; g.transform.position = pos; g.name = name + Random.Range(0, 10000); if (sprite != null) { g_sr.sprite = sprite; } g.renderer.sortingLayerName = sortLayer; return(g); }