cocos2d-x 粒子效果内存泄露及Unity一定范围内出怪实现备份。
2017-03-25 10:39
549 查看
std::string filename = "ExplodingRing.plist";
auto _emitter = ParticleSystemQuad::create(filename);
if (_emitter)
{
_emitter->setPosition(Vec2(rand_x, rand_y));
addChild(_emitter, 10);
_emitter->setAutoRemoveOnFinish(true);
}
===================包含图片的plist粒子效果文件会造成内存泄露。原因及修复XXXXX见如下地址。请允许我说一句粗口话,为这东西调了我超过2个星期时间才发现是引擎的问题,果然开源的东西 = 一堆人乱来?我可以确信的是,这个bug在最新的3.14版本没有得到修正。喜闻乐见
http://discuss.cocos2d-x.org/t/memory-leak-in-particle-system-v3-beta-2/11754/2
===================神坑cocos。。。。脱坑ing。
以下是unity一定范围内生成怪物的调试脚本。1秒一次 范围内随机。仅备份
using UnityEngine;
using System.Collections;
public class TestGenSc : MonoBehaviour {
// Use this for initialization
void Start () {
InvokeRepeating("GenMonster", 1, 1);
}
// Update is called once per frame
void Update () {
}
void GenMonster()
{
Vector2 v2 = Random.insideUnitCircle * 5.0f;
Vector3 v3 = new Vector3(v2.x, 0, v2.y);
GameObject ob = GameObject.CreatePrimitive(PrimitiveType.Cube);
ob.transform.position = gameObject.transform.position;
ob.transform.parent = gameObject.transform;
ob.transform.localPosition = v3;
ob.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f);
}
void OnDrawGizmos()
{
Gizmos.color = new Color(0.0f, 0.5f, 0.5f, 0.3f);
Gizmos.DrawSphere(transform.position, 5.0f);
}
}
auto _emitter = ParticleSystemQuad::create(filename);
if (_emitter)
{
_emitter->setPosition(Vec2(rand_x, rand_y));
addChild(_emitter, 10);
_emitter->setAutoRemoveOnFinish(true);
}
===================包含图片的plist粒子效果文件会造成内存泄露。原因及修复XXXXX见如下地址。请允许我说一句粗口话,为这东西调了我超过2个星期时间才发现是引擎的问题,果然开源的东西 = 一堆人乱来?我可以确信的是,这个bug在最新的3.14版本没有得到修正。喜闻乐见
http://discuss.cocos2d-x.org/t/memory-leak-in-particle-system-v3-beta-2/11754/2
===================神坑cocos。。。。脱坑ing。
以下是unity一定范围内生成怪物的调试脚本。1秒一次 范围内随机。仅备份
using UnityEngine;
using System.Collections;
public class TestGenSc : MonoBehaviour {
// Use this for initialization
void Start () {
InvokeRepeating("GenMonster", 1, 1);
}
// Update is called once per frame
void Update () {
}
void GenMonster()
{
Vector2 v2 = Random.insideUnitCircle * 5.0f;
Vector3 v3 = new Vector3(v2.x, 0, v2.y);
GameObject ob = GameObject.CreatePrimitive(PrimitiveType.Cube);
ob.transform.position = gameObject.transform.position;
ob.transform.parent = gameObject.transform;
ob.transform.localPosition = v3;
ob.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f);
}
void OnDrawGizmos()
{
Gizmos.color = new Color(0.0f, 0.5f, 0.5f, 0.3f);
Gizmos.DrawSphere(transform.position, 5.0f);
}
}
相关文章推荐
- Cocos2d-x 粒子系统----实现下雪效果
- Unity 粒子海洋效果实现
- 【Cocosd2d实例教程七】Cocos2d实现超炫的粒子效果!!
- Cocos2d中粒子效果的实现--1
- Cocos2d-x实现粒子效果的三种方式
- Cocos2d-x 粒子系统----实现下雪效果
- Cocos2d-x粒子系统 -- 实现下雪效果
- Unity 粒子海洋效果实现
- Cocos2D实现Fruit Ninja里面刀光效果教程
- cocos2d 实现翻转效果
- cocos2D 实现图形扭曲效果
- cocos2d中实现触摸按钮换图效果方案
- (译)Cocos2d_for_iPhone_1_Game_Development_Cookbook:1.14 使用AWTextureFilter实现毛边和字体阴影效果
- 【Cocos2d-x】新手自学(九)滚动背景..实现无限卷轴效果(2.0.1版本)
- cocos2d粒子效果
- cocos2d-x学习笔记(五)仿真树叶飘落效果的实现(精灵旋转、翻转、钟摆运动等综合运用)
- cocos2d-x 粒子效果优化
- 【iOS-cocos2d-X 游戏开发之十五】Cocos2dx中响应Android的Back(返回)与Menu(小房子)事件&&Cocos2dx自动释放粒子内存函数!
- cocos2d-x实现透视朦胧光照效果
- cocos2d-x 之粒子系统交互实现