Ejemplo n.º 1
0
 public bool remove(int id)
 {
     if (targetDic.ContainsKey(id))
     {
         newRemoveTime = Time.realtimeSinceStartup;
         if (targetDic[id] != null)
         {
             GameObject.DestroyImmediate(targetDic[id], true);
         }
         targetDic.Remove(id);
         if (targetDic.Count == 0)
         {
             MyCallLater.Add(waitingTime, removeFromResourcePool);
         }
         return(true);
     }
     return(false);
 }
Ejemplo n.º 2
0
        private void RemoveFromResoucePool()
        {
            if (poolList.Count > 0)
            {
                return;
            }
            float withoutUseTime = Time.realtimeSinceStartup - newRemoveTime;

            if (withoutUseTime >= waitingTime)
            {
                //resourcesPool.Remove(keyUrl);
                disPos();
            }
            else
            {
                MyCallLater.Add(waitingTime - withoutUseTime, RemoveFromResoucePool);
            }
        }
Ejemplo n.º 3
0
        public void removeFromResourcePool()
        {
            if (targetList.Count > 0)
            {
                return;
            }

            float withoutUseTime = Time.realtimeSinceStartup - newRemoveTime;

            if (withoutUseTime >= waitingTime)
            {
                BumLogic.poolManager.remove(keyUrl);
                dispose();
            }
            else
            {
                MyCallLater.Add(waitingTime - withoutUseTime, removeFromResourcePool);
            }
        }
Ejemplo n.º 4
0
 public void onPointerUp(PointerEventData eventData)
 {
     isDown            = false;
     scroRect.vertical = true;
     if (dragActive == false)
     {
         return;
     }
     if (dragToItem != null)
     {
         float   time = 0.2f;
         Vector2 pos  = uscroll.GetItemPos(dragToItem.index);
         GoToPos(rectTran, pos);
         MyCallLater.Add(time, laterChange);
     }
     else
     {
         Vector2 pos = uscroll.GetItemPos(index);
         GoToPos(rectTran, pos);
     }
     dragActive = false;
 }
 /// <summary>
 /// 当 手指抬起 执行
 /// </summary>
 /// <param name="eventData"></param>
 public void onPointerUp(PointerEventData eventData)
 {
     isDown            = false;
     scroRect.vertical = true;
     if (dragActive == false)
     {
         return;
     }
     if (dragToItem != null)
     {
         float   time = 0.2f;
         Vector2 pos  = schemeManifestScroll.GetLoaclPosByIndex(dragToItem.index);
         GoToPos(tranRect, pos);
         MyCallLater.Add(time, laterChange);
     }
     else
     {
         Vector2 pos = schemeManifestScroll.GetLoaclPosByIndex(index);
         GoToPos(tranRect, pos);
     }
     dragActive = false;
 }
    public override void mUpdate()
    {
        base.mUpdate();
        float delta = Input.GetAxis("Mouse ScrollWheel");

        if (delta != 0)
        {
            //ErrorDisplay.Log(delta);
            target.orthographicSize += delta;
            if (target.orthographicSize < 2)
            {
                target.orthographicSize = 2;
            }
            else if (Camera.main.orthographicSize > 50)
            {
                target.orthographicSize = 50;
            }
        }

        Vector3 v3 = Input.mousePosition;

        if (Input.GetMouseButtonDown(2))
        {
            oldPos = v3;
        }
        if (Input.GetMouseButton(2))
        {
            if (oldPos.x == v3.x && oldPos.y == v3.y)
            {
                return;
            }

            Vector2 offset = v3 - oldPos;
            oldPos = v3;
            //Debug.Log(offset + " / " + v2);
            target.transform.position -= (Vector3)offset / 100f;
            MyCallLater.Add(0.1f, RefreshView);
        }
    }
Ejemplo n.º 7
0
 public void loadError(SimpleLoader loader)
 {
     addError(loader.keyUrl);
     for (int i = 0; i < loadingkeyUrlList.Count; i++)
     {
         if (loadingkeyUrlList[i] == loader.keyUrl)
         {
             loadingkeyUrlList.RemoveAt(i);
             for (int k = 0; k < waitingLoaderList.Count; k++)
             {
                 SimpleLoader item = waitingLoaderList[k];
                 if (item.keyUrl == loader.keyUrl)
                 {
                     item.state = loader.state;
                     item.EndOnly();
                     waitingLoaderList.RemoveAt(k);
                     k--;
                 }
             }
         }
     }
     MyCallLater.Add(1, removeError, loader.keyUrl);
 }
Ejemplo n.º 8
0
 protected void showClickEffect(GameObject go)
 {
     go.SetActive(true);
     MyCallLater.Add(0.1f, hideImage, go);
 }
 protected override void OnNewUse()
 {
     base.OnNewUse();
     MyCallLater.Remove(RemoveFromResoucePool);
     MyCallLater.Add(waitingTime, RemoveFromResoucePool);
 }
Ejemplo n.º 10
0
 protected override void onNewUse()
 {
     base.onNewUse();
     MyCallLater.Remove(removeFromResourcePool);
     MyCallLater.Add(waitingTime, removeFromResourcePool);
 }