Exemple #1
0
 private void EFC_FadeInCol(bool isFadeIn, EfcCont ec)
 {
     if (null != ec)
     {
         this.actStartEfc();
         if (isFadeIn)
         {
             this.tempCol   = ec.GetColor();
             this.tempCol.a = this.offCol.a;
             ec.SetColor(this.tempCol);
             this.tempCol.a = this.onCol.a;
             ec.ColorTo(this.tempCol, this.fadeInTime, new Action <int>(this.actEndEfc), iTween.EaseType.linear, 0f);
         }
         else
         {
             this.tempCol   = ec.GetColor();
             this.tempCol.a = this.offCol.a;
             ec.ColorTo(this.tempCol, this.fadeOutTime, new Action <int>(this.actEndEfc), iTween.EaseType.linear, 0f);
         }
     }
 }
    private void ShowHideFacilityBtn(bool isPlaySE)
    {
        Vector2 zero = Vector2.zero;
        Color   c    = new Color(1f, 1f, 1f, 0f);

        if (!this.isShowBtnFacility)
        {
            this.isShowBtnFacility = true;
            float time = 0.2f;
            c.a = 1f;
            for (int i = 0; i < this.facilityChildButtonList.Count; i++)
            {
                GameObject  gameObject = this.facilityChildButtonList[i];
                EfcCont     component  = gameObject.GetComponent <EfcCont>();
                GUICollider component2 = gameObject.GetComponent <GUICollider>();
                component2.activeCollider = true;
                zero.x = component2.GetOriginalPos().x;
                zero.y = component2.GetOriginalPos().y;
                component.MoveTo(zero, time, null, iTween.EaseType.spring, 0f);
                zero.x = (zero.y = 1f);
                component.ScaleTo(zero, time, null, iTween.EaseType.spring, 0f);
                component.ColorTo(c, time, null, iTween.EaseType.spring, 0f);
                Transform transform = gameObject.transform.Find("Campaign");
                if (null != transform)
                {
                    component = transform.GetComponent <EfcCont>();
                    component.ScaleTo(zero, time, null, iTween.EaseType.linear, 0f);
                }
            }
            if (isPlaySE)
            {
                SoundMng.Instance().TryPlaySE("SEInternal/Farm/se_205", 0f, false, true, null, -1);
            }
            this.ResetFarmWork();
        }
        else
        {
            this.isShowBtnFacility = false;
            float time2 = 0.2f;
            c.a = 0f;
            for (int j = 0; j < this.facilityChildButtonList.Count; j++)
            {
                GameObject gameObject2 = this.facilityChildButtonList[j];
                EfcCont    component   = gameObject2.GetComponent <EfcCont>();
                component.MoveTo(zero, time2, null, iTween.EaseType.linear, 0f);
                GUICollider component2 = gameObject2.GetComponent <GUICollider>();
                component2.activeCollider = false;
                component.ScaleTo(Vector2.one, time2, null, iTween.EaseType.linear, 0f);
                component.ColorTo(c, time2, null, iTween.EaseType.linear, 0f);
                Transform transform2 = gameObject2.transform.Find("Campaign");
                if (null != transform2)
                {
                    component = transform2.GetComponent <EfcCont>();
                    component.ScaleTo(zero, time2, null, iTween.EaseType.linear, 0f);
                }
            }
            if (isPlaySE)
            {
                SoundMng soundMng = SoundMng.Instance();
                if (null != soundMng)
                {
                    soundMng.TryPlaySE("SEInternal/Farm/se_206", 0f, false, true, null, -1);
                }
            }
        }
        this.SetAllAlertIcon();
    }