cocos2d-x 粒子效果内存泄露及Unity一定范围内出怪实现备份

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,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.3f);
        Gizmos.DrawSphere(transform.position,5.0f);
    }
}

相关文章

    本文实践自 RayWenderlich、Ali Hafizji 的文章《...
Cocos-code-ide使用入门学习地点:杭州滨江邮箱:appdevzw@1...
第一次開始用手游引擎挺激动!!!进入正题。下载资源1:从C...
    Cocos2d-x是一款强大的基于OpenGLES的跨平台游戏开发...
1.  来源 QuickV3sample项目中的2048样例游戏,以及最近《...
   Cocos2d-x3.x已经支持使用CMake来进行构建了,这里尝试...