Exemple #1
0
 void UpAni(Vector2 endPos)
 {
     rtf.DOAnchorPos(endPos, 1).OnComplete(delegate()
     {
         Pooler.PutPoolObj(PoolType.TextPool.ToString(), gameObject);
     });
     //Tweener tweener = image.rectTransform.DOMove(Vector3.zero,1f);
     //设置这个Tween不受Time.scale影响
     //tweener.SetUpdate(true);
     ////设置移动类型
     //tweener.SetEase(Ease.Linear);
     //tweener.onComplete = delegate()
     //{
     //    Debug.Log("移动完毕事件");
     //};
 }
Exemple #2
0
    public void Fresh(FreshType type)
    {
        switch (type)
        {
        case FreshType.Hp:
            hp.text = hero.hp.ToString();
            break;

        case FreshType.Att:

            break;

        case FreshType.Die:
            Pooler.PutPoolObj(PoolType.HeroPool.ToString(), gameObject);
            break;
        }
    }
Exemple #3
0
    /// <summary>
    /// 刷新传送点
    /// </summary>
    void FreshDoors()
    {
        //回收
        int count = doorLayer.transform.childCount;

        for (int i = 0; i < count; i++)
        {
            GameObject childGo = doorLayer.transform.GetChild(0).gameObject;
            Pooler.PutPoolObj(PoolType.DoorPool.ToString(), childGo);
        }
        //再利用
        Vector2[] doors = TileModel.currentTile.doors;
        for (int i = 0; i < doors.Length; i++)
        {
            GameObject doorGo = Pooler.GetPoolObj(PoolType.DoorPool.ToString());
            doorGo.transform.SetParent(doorLayer.transform);
            doorGo.GetComponent <DoorView>().InitData(doors[i], i);
        }
    }
Exemple #4
0
    /// <summary>
    /// 刷新英雄
    /// </summary>
    void FreshHeros()
    {
        //回收
        int count = heroLayer.transform.childCount;

        for (int i = 0; i < count; i++)
        {
            GameObject childGo = heroLayer.transform.GetChild(0).gameObject;
            Pooler.PutPoolObj(PoolType.HeroPool.ToString(), childGo);
        }
        //再利用
        Dictionary <int, HeroJson> heroMap = HerosModel.GetHeroMap();

        foreach (var pair in heroMap)
        {
            GameObject heroGo = Pooler.GetPoolObj(PoolType.HeroPool.ToString());
            heroGo.transform.SetParent(heroLayer.transform);
            heroGo.GetComponent <HeroView>().InitData(pair.Value.heroId);
            heroGo.name = pair.Value.heroId.ToString();
        }
    }
Exemple #5
0
 public void PutPoolObj(string name, GameObject go)
 {
     Pooler.PutPoolObj(name, go);
 }