public static MinifiedMainCollectable Minify(MainCollectable mainCollectable) { return(new MinifiedMainCollectable { id = mainCollectable.id, name = mainCollectable.name, position = mainCollectable.transform.position }); }
public void Collect(Collectable collectable) { OnCollectCoin(collectable); if (collectable is MainCollectable) { mainPickups++; MainCollectable mainCollectable = (MainCollectable)collectable; if (mainCollectable.HasBeenCollectedBefore()) { return; } minifiedMainCollectables.Add(MainCollectable.Minify(mainCollectable)); } else { sidePickups++; OnSideCollectableIncreased.Invoke(sidePickups); } }