public void CreateCollectable(Vector3 pos) { GameObject newGameObject = Instantiate(prefab); newGameObject.transform.position = pos; newGameObject.transform.localScale = new Vector3(.4f, .4f, .4f); newGameObject.GetComponent <Renderer> ( ).material.color = 1.2f * new Color(Random.value, Random.value, Random.value); Collectable_m newCollectable = newGameObject.GetComponent <Collectable_m>(); newCollectable.collectableController = this; collectables.Add(newCollectable); }
public void RemoveCollectable(Collectable_m collectable) { collectables.Remove(collectable); }