public void CreateDropTargetBank(GameObject dropTargetGo, DropTargetComponent dropTargetComponent) { var dropTargetBank = dropTargetGo.AddComponent <DropTargetBankComponent>(); dropTargetBank.BankSize = 1; dropTargetBank.DropTargets = new[] { dropTargetComponent }; }
public void CheckForActiveTargetsAfterAllDropped() { DropTargetManager[] dropTargetManagers = GameObject.FindObjectsOfType <DropTargetManager>(); for (int i = 0; i < dropTargetManagers.Length; i++) { DropTargetManager dropTargetManager = dropTargetManagers[i]; //Drop all targets within a manager. for (int j = 0; j < dropTargetManager.transform.childCount; j++) { DropTargetComponent dropTargetComponent = dropTargetManager.transform.GetChild(j).GetComponent <DropTargetComponent>(); if (!dropTargetComponent.Active) { dropTargetComponent.DropTarget(); } } //Loop through the targets again and make sure they've reset. for (int j = 0; j < dropTargetManager.transform.childCount; j++) { DropTargetComponent dropTargetComponent = dropTargetManager.transform.GetChild(j).GetComponent <DropTargetComponent>(); Assert.IsTrue(dropTargetComponent.Active); } } }