Exemple #1
0
    public override void OnInspectorGUI()
    {
        GUILayout.Space(6f);
        NGUIEditorTools.SetLabelWidth(120f);

        TweenFillAmount tw = target as TweenFillAmount;

        GUI.changed = false;

        float from = EditorGUILayout.Slider("From", tw.from, 0f, 1f);
        float to   = EditorGUILayout.Slider("To", tw.to, 0f, 1f);

        if (GUI.changed)
        {
            NGUIEditorTools.RegisterUndo("Tween Change", tw);
            tw.from = from;
            tw.to   = to;
            if (preview)
            {
                tw.Sample(tw.tweenFactor, false);
            }
            NGUITools.SetDirty(tw);
        }

        DrawCommonProperties();
    }
Exemple #2
0
        protected override void OnInit()
        {
            m_special_view = Make <GameUIComponent>("Panel_special");
            m_input        = Make <GameUIComponent>("Input");
            m_blood        = Make <GameImage>("Image_Blood_Root:Image_Blood");
            m_fill_tween   = this.gameObject.transform.Find("Panel_special/Image (3)").GetComponent <TweenFillAmount>();

            m_special_view.Visible = false;
        }
Exemple #3
0
    /// <summary>
    /// Start the tweening operation.
    /// </summary>
    static public TweenFillAmount Begin(GameObject go, float duration, float targetAlpha)
    {
        TweenFillAmount comp = UITweener.Begin <TweenFillAmount>(go, duration);

        comp.from = comp.value;
        comp.to   = targetAlpha;

        return(comp);
    }
    /// <summary>
    /// Start the tweening operation.
    /// </summary>

    static public TweenFillAmount Begin(GameObject go, float duration, float fillAmount)
    {
        TweenFillAmount comp = UITweener.Begin <TweenFillAmount>(go, duration);

        comp.from = comp.value;
        comp.to   = fillAmount;

        if (duration <= 0f)
        {
            comp.Sample(1f, true);
            comp.enabled = false;
        }
        return(comp);
    }
    /// Start the tweening operation.
    /// </summary>

    static public TweenFillAmount Begin(GameObject widget, UISprite target, float duration, float value)
    {
        mBasic = target;
        TweenFillAmount comp = UITweener.Begin <TweenFillAmount>(widget, duration);

        comp.from = mBasic.fillAmount;
        comp.to   = value;

        if (duration <= 0f)
        {
            comp.Sample(1f, true);
            comp.enabled = false;
        }
        return(comp);
    }
Exemple #6
0
    private void SetTime()
    {
        DateTime noewtime  = Util.GetServerLocalTime();
        string   closetime = PlayerPrefs.GetString(moduleHome.CloseKey());
        DateTime check     = Util.GetServerLocalTime();

        if (string.IsNullOrEmpty(closetime) || !DateTime.TryParse(closetime, out check))
        {
            closetime = Util.GetServerLocalTime().ToString();
            PlayerPrefs.SetString(moduleHome.CloseKey(), closetime);
            Logger.LogError("Module_Home : Pet task close time is null");
        }
        DateTime closeend = Convert.ToDateTime(closetime);

        string month = "/" + closeend.Month.ToString();

        if (closeend.Month < 10)
        {
            month = "/" + "0" + closeend.Month.ToString();
        }
        string days = "/" + closeend.Day.ToString();

        if (closeend.Day < 10)
        {
            days = "/" + "0" + closeend.Day.ToString();
        }
        string   refresh     = closeend.Year.ToString() + month + days + " " + "05:" + "00:" + "00";
        DateTime refreshtime = DateTime.ParseExact(refresh, "yyyy/MM/dd HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture);

        DateTime nexttime = refreshtime;

        if (closeend.Hour >= 5)
        {
            //距离日期加一
            nexttime = refreshtime.AddDays(1);
        }
        TimeSpan refreshremain = nexttime - noewtime; //当前与刷新相差多少
        TimeSpan allremain     = nexttime - closeend; //关闭时与刷新相差多少

        float durationtime = (float)refreshremain.TotalSeconds;
        float alltime      = (float)allremain.TotalSeconds;

        TweenFillAmount amount = m_waitprogress.GetComponent <TweenFillAmount>();

        amount.duration = durationtime;
        amount.from     = durationtime / alltime;
    }