Ejemplo n.º 1
0
 public void updateDepth()
 {
     sptAnima.GetComponent <UISprite>().depth = 20 - (int)Mathf.Round(transform.localPosition.y);
     handIcon.depth = sptAnima.GetComponent <UISprite>().depth + 1000;
     expBar.backgroundWidget.depth = sptAnima.GetComponent <UISprite>().depth + 1000;
     expBar.foregroundWidget.depth = sptAnima.GetComponent <UISprite>().depth + 1001;
 }
Ejemplo n.º 2
0
        void StopRocking(UISpriteAnimation dice)
        {
            dice.enabled = false;
            var spr = dice.GetComponent <UISprite>();

            spr.spriteName = "defult";
        }
Ejemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     _comboPanelTransform      = _comboPanel.transform;
     _comboBackgroundTransform = _comboBackground.transform;
     _mySprite    = _comboBackground.GetComponent <UISprite>();
     CurrentCount = 0;
 }
Ejemplo n.º 4
0
    void AoYiExploreMove(UISpriteAnimation whichone)
    {
        whichone.AnimationEndDelegate = null;

        UISprite explore = whichone.GetComponent <UISprite>();

        explore.spriteName = "blood6";
        MiniItween.MoveTo(explore.gameObject, Vector3.zero, MoveRedPointTime, true);
        MiniItween.ColorTo(explore.gameObject, new V4(new Color(1.0f, 1.0f, 1.0f, RedPointHideAlpha)), MoveRedPointTime, MiniItween.EasingType.EaseInQuad, MiniItween.Type.ColorWidget);
        MiniItween.ScaleTo(explore.gameObject, RedPointHideScale, MoveRedPointTime).FinishedAnim = () => { StartCoroutine(DragonAppear());  whichone.gameObject.SetActive(false); };
    }
Ejemplo n.º 5
0
    /*收回
     * */
    void Change4()
    {
        mouthAnima.enabled = false;
        UISprite mouth = mouthAnima.GetComponent <UISprite>();

        mouth.spriteName = "Mouth 3";
        mouth.MakePixelPerfect();
        TweenPosition TP = all.GetComponent <TweenPosition>();       //TweenPosition.Begin(all,0.1f,new Vector3(-640f,-450f,0));

        TP.onFinished.Clear();
        TP.onFinished.Add(new EventDelegate(this, "Change5"));
        TP.PlayReverse();
    }
Ejemplo n.º 6
0
 public IEnumerator CreateInstance(GameObject crossbow, GameObject trigger, UISpriteAnimation _bow, float T)
 {
     yield return new WaitForSeconds(0.0f);
     T -= Time.deltaTime * 20;
     if (T <= 0)
     {
         GameObject newArrow = (GameObject)Instantiate(crossbow);
         newArrow.transform.parent = trigger.transform;
         newArrow.transform.localPosition = Vector3.zero;
         newArrow.transform.localScale = crossbow.transform.localScale;
         Destroy(newArrow.GetComponent<FaceMovementDirection>());
         newArrow.rigidbody.useGravity = false;
         newArrow.name = "CrossBolt";
     }
     else
     {
         if (_bow.frames - 1 >= (int)T)
         {
             _bow.GetComponent<UISprite>().spriteName = "CrossbowLine_" + ((int)T).ToString() + ".psd";
         }
         else
         {
             _bow.GetComponent<UISprite>().spriteName = "CrossbowLine_" + (_bow.frames - 1).ToString() + ".psd";
         }
         Debug.Log(_bow.GetComponent<UISprite>().spriteName);
         StartCoroutine(CreateInstance(crossbow,trigger,_bow,T));
     }
 }
Ejemplo n.º 7
0
    //重置红点的位置
    private void resetRedPoint(string aYName = null, bool resetAoYiList = false)
    {
        //位置
        int count = Att_AoYiList.items.Length;

        int posNum = -1;


        for (int i = 0; i < count; i++)
        {
            if (Att_AoYiList.items [i] != null)
            {
                if (Att_AoYiList.items [i].Icon.spriteName != null)
                {
                    if (Att_AoYiList.items [i].gameObject.activeInHierarchy == true)
                    {
                        int      tAoYiNum = int.Parse(Att_AoYiList.items [i].Icon.spriteName);
                        AoYiData tData    = Core.Data.dragonManager.getAoYiData(tAoYiNum);
                        if (tData != null && tData.name == aYName)
                        {
                            posNum += (i + 1);
                            break;
                        }
                    }
                    else
                    {
                        posNum--;
                    }
                }
            }
        }

        if (posNum == -1)
        {
            posNum = 0;
        }
        if (WhoAttack)
        {
            Att_Explore.transform.localPosition = initAttRedPosition + (40 * posNum) * Vector3.right;
        }
        else
        {
            Def_Explore.transform.localPosition = initDefRedPosition + (40 * posNum) * Vector3.right;
        }

//		Debug.Log ("     attt  pos  ===  " +Att_Explore.transform.localPosition  );


        if (resetAoYiList)
        {
            ResetAYList();
//			Att_AoYiList.AoYiList.transform.localPosition = initAttAoYiPosition;
//			Att_AoYiList.AoYiList.transform.localPosition = initAttAoYiPosition;
//			Def_AoYiList.AoYiList.transform.localPosition = initDefAoYiPosition;
        }



        //颜色
        UISprite sprite = Att_Explore.GetComponent <UISprite>();

        sprite.color = Color.white;

        sprite       = Def_Explore.GetComponent <UISprite>();
        sprite.color = Color.white;

        //大小
        Att_Explore.transform.localScale = Vector3.one;
        Def_Explore.transform.localScale = Vector3.one;

        //
        Att_Explore.gameObject.SetActive(false);
        Def_Explore.gameObject.SetActive(false);

        //龙要隐藏
        BigDragon.SetActive(false);
    }