Exemple #1
0
 private void EFC_FadeIn(bool isFadeIn, EfcCont ec, Vector3 vORG, EfcParam param)
 {
     if (null != ec)
     {
         this.actStartEfc();
         if (isFadeIn)
         {
             Vector3 pos = vORG + param.vOffset;
             ec.SetPos(pos);
             Vector2 vP = new Vector2(vORG.x, vORG.y);
             ec.MoveTo(vP, param.time, new Action <int>(this.actEndEfc), param.type, param.delay);
         }
         else
         {
             Vector3 vector = vORG + param.vOffsetEnd;
             Vector2 vP2    = new Vector2(vector.x, vector.y);
             ec.MoveTo(vP2, param.time, new Action <int>(this.actEndEfc), param.typeEnd, param.delay);
         }
     }
 }
    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();
    }