Ejemplo n.º 1
0
    IEnumerator RunUnPinnAnim()
    {
        if (SelfPinn == null)
        {
            yield break;
        }
        IsRunning = true;
        //Shift all life index
        ShortCutMain.ShiftDown(index);
        //swap item to Left Side
        float   shiftDist  = ShiftCount * 0.6f;
        Vector3 currentPos = transform.localPosition;
        Vector3 targetPos  = new Vector3(normalPosition.x, normalPosition.y + shiftDist, normalPosition.z);

        while (Vector3.Distance(currentPos, targetPos) > 0.05f)
        {
            shiftDist               = ShiftCount * 0.6f;
            targetPos.y             = normalPosition.y + shiftDist;
            currentPos              = Vector3.Lerp(currentPos, targetPos, Time.deltaTime * 5);
            transform.localPosition = currentPos;
            yield return(null);
        }
        transform.localPosition = targetPos;
        IsRunning = false;
        if (EventTextCollider != null)
        {
            EventTextCollider.enabled = true;
        }
    }
Ejemplo n.º 2
0
    IEnumerator RunPinnAnim()
    {
        if (SelfPinn == null)
        {
            yield break;
        }
        IsRunning = true;
        //Shift all life index
        ShortCutMain.ShiftUp(index);
        PinnHeader.AddItem(SelfPinn);
        //swap item to Left Side
        Vector3 currentPos = transform.localPosition;
        Vector3 targetPos  = new Vector3(-8, currentPos.y, 0);

        while (Vector3.Distance(currentPos, targetPos) > 0.05f)
        {
            targetPos.y             = currentPos.y;
            currentPos              = Vector3.Lerp(currentPos, targetPos, Time.deltaTime * 5);
            transform.localPosition = currentPos;
            yield return(null);
        }
        transform.localPosition = targetPos;
        IsRunning = false;
    }
Ejemplo n.º 3
0
 void Awake()
 {
     pGlobal = this;
 }