Esempio n. 1
0
 public void NullFunction()
 {
     if (!reward.activeSelf)
     {
         runstage = normalstage;
     }
 }
Esempio n. 2
0
 public void animationopen()
 {
     if (transform.localScale.x < 0.99f)
     {
         transform.localScale += Vector3.one * (Time.realtimeSinceStartup - oStartUp) * 6f;
     }
     else
     {
         transform.localScale = new Vector3(1f, 1f, 0);
         animation            = nullfunction;
     }
     oStartUp = Time.realtimeSinceStartup;
 }
Esempio n. 3
0
 public void GiftStageControl()
 {
     if (isStart)
     {
         StartIndex = giftindex;
         runstage   = startstage;
         isStart    = false;
     }
     if (isSlowdown)
     {
         runstage   = slowdownstage;
         isSlowdown = false;
     }
 }
Esempio n. 4
0
    public void InitEnergy()
    {
        if (localxml[1] < AllEnergy)
        {
            if (year > localxml[2] && localxml[2] != 0)
            {
                localxml[1] = AllEnergy;
                localxml[8] = 0;
                //  GameInfoXMLCenterControl.SaveFunction();
                //  GameInfoXMLCenterControl.LoadFunction();
                order = NullFuntion;
                timer.gameObject.SetActive(false);
            }
            else
            {
                int temptime = (int)SplitTime();
                if (temptime > ((AllEnergy - 1) - localxml[1]) * addEnergytime * 60 + localxml[8])
                {
                    localxml[1] = AllEnergy;
                    localxml[8] = 0;
                    // GameInfoXMLCenterControl.SaveFunction();
                    // GameInfoXMLCenterControl.LoadFunction();
                    order = NullFuntion;
                    timer.gameObject.SetActive(false);
                }
                else
                {
                    timer.gameObject.SetActive(true);
                    localxml[1] += temptime / (addEnergytime * 60);
                    localxml[8] -= (temptime % (addEnergytime * 60));
                    // GameInfoXMLCenterControl.SaveFunction();
                    // GameInfoXMLCenterControl.LoadFunction();
                    Et.SetTime(localxml[8]);
                    order = SubTimer;
                }
            }
        }
        else
        {
            timer.gameObject.SetActive(false);

            order = NullFuntion;
        }
        transform.GetChild(0).GetComponent <Text>().text = localxml[1].ToString();
    }
Esempio n. 5
0
 private int[] localxml;//1体力值,2年,4天,5小时,6分钟,7秒,8恢复一点体力剩余时间
 void Start()
 {
     AllEnergy     = 10;
     addEnergytime = 6;
     Et            = new PEIKnifer_Timer();
     order         = NullFuntion;
     InitEnergy();
     if (localxml[2] == 0)
     {
         localxml[2] = System.DateTime.Now.Year;
         localxml[4] = System.DateTime.Now.DayOfYear;
         localxml[5] = System.DateTime.Now.Hour;
         localxml[6] = System.DateTime.Now.Minute;
         localxml[7] = System.DateTime.Now.Second;
         // GameInfoXMLCenterControl.SaveFunction();
         // GameInfoXMLCenterControl.LoadFunction();
     }
 }
Esempio n. 6
0
    private bool isSlowdown;  //是否开始减速
    void Start()
    {
        timer1 = new PEIKnifer_Timer();
        timer2 = new PEIKnifer_Timer();
        timer3 = new PEIKnifer_Timer();
        InitGifts();
        allindex = new int[100];
        int tempadd = 0;

        for (int i = 0; i < probability.Length; i++)
        {
            for (int a = tempadd; a < tempadd + probability[i]; a++)
            {
                allindex[a] = i;
            }
            tempadd += probability[i];
        }
        runstage = normalstage;
    }
Esempio n. 7
0
 public void slowdownstage()
 {
     if (timer3.Timer())
     {
         timer3.Clear();
         giftindex++;
         if (giftindex >= gifts.transform.childCount)
         {
             giftindex = 0;
         }
         mark.transform.localPosition = gifts.transform.GetChild(giftindex).transform.localPosition;
         timer3.SetTime(t3 / gifts.transform.childCount);
         if (giftindex == randemgift())
         {
             reward.GetComponent <ShowReward>().Refresh();
             reward.SetActive(true);
             runstage = NullFunction;
         }
     }
 }
Esempio n. 8
0
 public void startstage()
 {
     if (timer2.Timer())
     {
         timer2.Clear();
         giftindex++;
         if (giftindex >= gifts.transform.childCount)
         {
             giftindex = 0;
         }
         if (giftindex == StartIndex)
         {
             roundnum++;
         }
         mark.transform.localPosition = gifts.transform.GetChild(giftindex).transform.localPosition;
         timer2.SetTime(t2 / gifts.transform.childCount);
         if (roundnum > allround)
         {
             runstage = bufferstage;
         }
     }
 }
Esempio n. 9
0
    public void AddEnergy(int _index)
    {
        localxml[1] += _index;
        // GameInfoXMLCenterControl.SaveFunction();
        // GameInfoXMLCenterControl.LoadFunction();
        if (localxml[1] > (AllEnergy - 1))
        {
            timer.SetActive(false);
            order = NullFuntion;
        }
        else
        {
            if (localxml[8] == 0)
            {
                localxml[8] = addEnergytime * 60;
            }
            // InitEnergy();

            // GameInfoXMLCenterControl.SaveFunction();
            // GameInfoXMLCenterControl.LoadFunction();
            Et.SetTime(localxml[8]);
        }
    }
Esempio n. 10
0
 void Start()
 {
     oStartUp  = Time.realtimeSinceStartup;
     animation = animationopen;
 }
Esempio n. 11
0
 public void Refresh()
 {
     transform.localScale = Vector3.zero;
     animation            = animationopen;
     oStartUp             = Time.realtimeSinceStartup;
 }