public void Init(DogSlot dogSlot, Dog dog) { this.dog = dog; nameText.text = dog.Info.Name; dogSlot.SubscribeToClickWhenOccupied(show); Hide(); }
// WARNING: Do not set callback to true from w/in the slot, otherwise you risk creating stackoverflow public void LeaveCurrentSlot(bool callback, bool stopScouting) { if (stopScouting) { dataController.ScoutingDogs.Remove(this.Info); } if (callback && slot) { this.slot.ClearSlot(); } this.slot = null; }
public bool TryFindOpenSlot(out DogSlot openSlot) { for (int i = 0; i < scoutingSlots.Length; i++) { if (!scoutingSlots[i].HasDog) { openSlot = scoutingSlots[i]; return(true); } } openSlot = null; return(false); }
protected virtual void showDogProfile(Dog dog) { EventController.Event(k.GetPlayEvent(k.MENU_POPUP)); DogSlot dogSlot = dog.OccupiedSlot; if (dogSlot && dogSlot.GetType() == typeof(DogShelterSlot)) { dogProfile = dogProfileShelterObject.GetComponent <DogProfile>(); } else { dogProfile = dogProfileObject.GetComponent <DogProfile>(); dogProfile.buttonController.Init(dogProfile, PPDataController.GetInstance.AdoptedDogs.ToArray()); } dogProfile.Show(); dogProfile.SetProfile(dog); }
void placeDogs(Dog[] dogs) { for (int i = 0; i < dogSlots.Length && i < dogs.Length; i++) { Dog currentDog = dogs[i]; DogSlot currentSlot = dogSlots[i]; if (currentDog.Info.EmptyDescriptor) { currentSlot.Hide(); } else { currentSlot.Init(currentDog, inScoutingSelectMode: true); currentSlot.SubscribeToClickWhenOccupied(selectDogSlot); if (currentDog.IsScouting) { currentSlot.Hide(); } } } }
public void ClearTargetSlot() { this.targetSlot = null; }
public void SetTargetSlot(DogSlot slot) { this.targetSlot = slot; }
public void AssignSlot(DogSlot slot) { this.slot = slot; }
protected override void fetchReferences() { base.fetchReferences(); GetComponent <UIButton>().SubscribeToClick(Pet); dogSlot = GetComponent <DogWorldSlot>(); }