コード例 #1
0
        int _buyCount  = 0; //购买拍照次数

        /// <summary>
        /// 初始化数据
        /// </summary>
        /// <param name="res"></param>
        public void InitRunningInfo(StartTakePhotoRes res)
        {
            _takePhotosGameRunningInfo = new TakePhotosGameRunningInfo();
            /////test
            //for(int i=18;i< _takePhotoRulePBs.Count;i++)
            //{
            //    var v = _takePhotoRulePBs[i];
            //    var rule = GetRulePbById(v.Id);
            //    if (rule == null)
            //    {
            //        Debug.LogError("don't find rule id" + rule.Id);
            //        continue;
            //    }
            //    var vo = new TakePhotoGamePhotoVo(rule);
            //    vo.Id = v.Id;
            //    _takePhotosGameRunningInfo.AddTakePhotoGamePhotoVo(vo);
            //}
            ////test end

            foreach (var v in res.PictureId)
            {
                var rule = GetRulePbById(v);
                if (rule == null)
                {
                    Debug.LogError("don't find rule id" + rule.Id);
                    continue;
                }
                var vo = new TakePhotoGamePhotoVo(rule);
                vo.Id = v;
                _takePhotosGameRunningInfo.AddTakePhotoGamePhotoVo(vo);
            }
            _takePhotosGameRunningInfo.Init();
        }
コード例 #2
0
    void HandleTexture(TakePhotoGamePhotoVo vo)
    {
        if (vo == null)
        {
            return;
        }
        var t = ResourceManager.Load <Texture>(vo.resoucePath);

        originTexture = Texture2Texture2D(t);
        targetTexture = GenerateTexture(originTexture, -vo.targetPos, targetWidth, targeHight, vo.scale);

        vo.targetTexture = targetTexture;
    }
コード例 #3
0
 public void AddTakePhotoGamePhotoVo(TakePhotoGamePhotoVo vo)
 {
     _photoVos.Add(vo);
 }