示例#1
0
    // 回收雪花
    private void OnSnowMeltEnd(SnowMelt snowMelt)
    {
        if (snowMelt != null)
        {
            snowMelt.Hide();

            AddSnowMelt(mSnowMeltHideDic, snowMelt);
            RemoveSnowMelt(mSnowMeltShowingDic, snowMelt);
        }
    }
示例#2
0
    // 创建一个雪花
    private SnowMelt CreateSnowMelt(int snowType)
    {
        SnowMelt newSnowMelt = null;

        if (0 <= snowType && snowType < mSnowTypeCount)
        {
            GameObject snowGo        = mSnowGoList[snowType];
            Vector3    preLocalScale = snowGo.transform.localScale;
            GameObject newGo         = GameObject.Instantiate(snowGo);
            newGo.transform.parent        = transform;
            newGo.transform.localRotation = Quaternion.identity;
            newGo.transform.localScale    = preLocalScale * mSnowLocalScaleFactor;
            newSnowMelt = newGo.GetComponent <SnowMelt>();
            newSnowMelt.Init();
            newSnowMelt.SetSnowType(snowType, mOnSnowMeltEndCallback);
            newSnowMelt.Hide();
        }

        return(newSnowMelt);
    }
示例#3
0
    // 结束融化,回收雪花并隐藏自身,可重新开始
    public void Hide()
    {
        var et = mSnowMeltShowingDic.GetEnumerator();

        while (et.MoveNext())
        {
            List <SnowMelt> list = et.Current.Value;
            if (list == null)
            {
                continue;
            }
            for (int i = 0, max = list.Count; i < max; ++i)
            {
                SnowMelt snowMelt = list[0];
                list.RemoveAt(0);

                snowMelt.Hide();
                AddSnowMelt(mSnowMeltHideDic, snowMelt);
            }
        }
    }