// Use this for initialization void Start() { foreach (GameObject lockedAnimal in lockedAnimals.GetAsNewList()) { TryToMakeItInteractable(lockedAnimal.transform); } }
// Use this for initialization void Start() { foreach (GameObject lockedAnimal in lockedAnimals.GetAsNewList()) { lockedAnimal.AddComponent <MakeUnavailable>(); } enabled = false; }
// Use this for initialization void Start() { foreach (GameObject lockedAnimal in lockedAnimals.GetAsNewList()) { // Add cuteLock to locked animal if (cuteLockPrefab != null) { GameObject cuteLock = Instantiate <GameObject>(cuteLockPrefab); cuteLock.transform.localScale = new Vector3(0.3f, 0.3f, 1.0f); cuteLock.transform.parent = transform; cuteLock.name = lockedAnimal.name; Follow follow = cuteLock.AddComponent <Follow>(); follow.target = lockedAnimal.transform; if (cuteLocks != null) { cuteLocks.Add(cuteLock.name, cuteLock); } } } enabled = false; }