Esempio n. 1
0
 public void Init(DogSlot dogSlot, Dog dog)
 {
     this.dog      = dog;
     nameText.text = dog.Info.Name;
     dogSlot.SubscribeToClickWhenOccupied(show);
     Hide();
 }
Esempio n. 2
0
 // 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;
 }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
    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);
    }
Esempio n. 5
0
    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();
                }
            }
        }
    }
Esempio n. 6
0
 public void ClearTargetSlot()
 {
     this.targetSlot = null;
 }
Esempio n. 7
0
 public void SetTargetSlot(DogSlot slot)
 {
     this.targetSlot = slot;
 }
Esempio n. 8
0
 public void AssignSlot(DogSlot slot)
 {
     this.slot = slot;
 }
Esempio n. 9
0
 protected override void fetchReferences()
 {
     base.fetchReferences();
     GetComponent <UIButton>().SubscribeToClick(Pet);
     dogSlot = GetComponent <DogWorldSlot>();
 }