Example #1
0
    // Use this for initialization
    void Start()
    {
        dailyEventsController = GetComponent <DailyEventsController>();
        currentDay            = 0; // Mardi

        daysEvents.Add(dailyEventsController.SelectRandomEvent(dailyEventsController.RandomRarity()));
        daysEvents.Add(dailyEventsController.SelectRandomEvent(dailyEventsController.RandomRarity()));
        daysEvents.Add(dailyEventsController.SelectRandomEvent(dailyEventsController.RandomRarity()));
        daysEvents.Add(dailyEventsController.SelectRandomEvent(dailyEventsController.RandomRarity()));
        daysEvents.Add(dailyEventsController.SelectRandomEvent(dailyEventsController.RandomRarity()));
        daysEvents.Add(dailyEventsController.SelectRandomEvent(dailyEventsController.RandomRarity()));

        currentEvent = daysEvents[currentDay];
        daysTransform.Add(days.GetChild(0).gameObject);
        daysTransform.Add(days.GetChild(1).gameObject);
        daysTransform[1].SetActive(false);
        daysTransform.Add(days.GetChild(2).gameObject);
        daysTransform[2].SetActive(false);
        daysTransform.Add(days.GetChild(3).gameObject);
        daysTransform[3].SetActive(false);
        daysTransform.Add(days.GetChild(4).gameObject);
        daysTransform[4].SetActive(false);
        daysTransform.Add(days.GetChild(5).gameObject);
        daysTransform[5].SetActive(false);



        WriteDailyEvent();
    }
Example #2
0
 void NextPage()
 {
     daysTransform[currentDay].GetComponent <PageRotation>().enabled = true;
     currentDay++;
     currentEvent = daysEvents[currentDay];
     daysTransform[currentDay].SetActive(true);
     WriteDailyEvent();
 }
    public DailyEvent GetRandomDailyEvent(DaysEnum startingDay)
    {
        int        position   = Random.Range(0, this.dailyEvents.Count);
        DailyEvent dailyEvent = this.dailyEvents[position];

        dailyEvent.startingDay = startingDay;
        return(dailyEvent);
    }
        private void ControlLoaded(object sender, RoutedEventArgs e)
        {
            dc = (DailyEvent)DataContext;
            var fac = 1 / ((1 / .45) * Math.Pow(Math.E, 8 * dc.DurationFactor) + 1 / (2 * .45));

            scaleUp = new DoubleAnimation(1.01, TimeSpan.FromMilliseconds(800))
            {
                EasingFunction = new ElasticEase()
            };
            scaleDown = new DoubleAnimation(1, TimeSpan.FromMilliseconds(150))
            {
                EasingFunction = new QuadraticEase()
            };
        }
Example #5
0
 public void AddEvent(DailyEvent ev)
 {
     Dispatcher.Invoke(() => Events.Add(ev));
     //Events.Insert(0, ev);
 }
Example #6
0
 static int SortByRarity(DailyEvent e1, DailyEvent e2)
 {
     return(e1.rarity.CompareTo(e2.rarity));
 }
Example #7
0
 public Task RaiseDailyEvent() => DailyEvent.InvokeAsync();