private void CheckSnapStatus() { if (NumofSnapped < SnapZones.Length) { return; } CollectableObject_Basic Collectable = gameObject.AddComponent <CollectableObject_Basic>(); Collectable.IsCollectable = true; Debug.Log("Collectable Set true"); Collectable.type = ItemType.Modem; }
private void SetCollectable() { foreach (var go in CollectableObjects) { if (go != null) { CollectableObject_Basic Collectable = go.GetComponent <CollectableObject_Basic>(); if (Collectable != null) { Collectable.IsCollectable = true; } else { CollectableObject_Basic[] Collectables = go.GetComponentsInChildren <CollectableObject_Basic>(); foreach (var item in Collectables) { item.IsCollectable = true; } } } } }