private void CreateBullet()
    {
        IRecycleAble         ra = Bullet.GetComponent <Bullet>();
        Queue <IRecycleAble> q  = new Queue <IRecycleAble>();

        for (int i = 0; i < ra.InitNum(); i++)
        {
            Bullet bt = Instantiate(Bullet, m_RecyclePoint.ToVector3(), Quaternion.identity).GetComponent <Bullet>();
            bt.IsCollisionAble = false;
            q.Enqueue(bt);
        }
        m_Op.AddNewObj(ra.RecycleName(), q);
    }
    private void DrawDynamicObj()
    {
        List <MGFObject> dynamicObj = PhysicsManager.Instance.GetAllDynamicObjs();

        Gizmos.color = new Color(0.5f, 0.9f, 0f, 0.3f);
        for (int i = 0; i < dynamicObj.Count; i++)
        {
            if (Quadtree.dic.ContainsKey(dynamicObj[i]) == false || Quadtree.dic[dynamicObj[i]] == null)
            {
                continue;
            }
            Fix64Vector2 center   = Quadtree.dic[dynamicObj[i]].GetCenter().center;
            Fix64Vector2 halfSize = Quadtree.dic[dynamicObj[i]].GetCenter().halfSize;
            Gizmos.DrawCube(center.ToVector3(), (halfSize * 2).ToVector3());
        }
    }
示例#3
0
    private void DrawDynamicObj()
    {
        var dynamicObj = PhysicsManager.Instance.GetAllDynamicObjs();

        Gizmos.color = new Color(0.5f, 0.9f, 0f, 0.3f);

        foreach (var item in dynamicObj)
        {
            if (Quadtree.dic.ContainsKey(item) == false || Quadtree.dic[item] == null)
            {
                continue;
            }
            Fix64Vector2 center   = Quadtree.dic[item].GetCenter().center;
            Fix64Vector2 halfSize = Quadtree.dic[item].GetCenter().halfSize;
            Gizmos.DrawCube(center.ToVector3(), (halfSize * 2).ToVector3());
        }
    }