Init() public static method

public static Init ( ) : void
return void
Beispiel #1
0
    public bool Init()
    {
        UTestPrototypes.Init();

        m_quadtree = new UQuadtree(Bound);

        m_instRoot = GameObject.Find("Instances");
        if (m_instRoot == null)
        {
            return(false);
        }

        for (int i = 0; i < 5000; i++)
        {
            UTestQtUserData ud = UTestPrototypes.NewRandom();
            if (ud != null)
            {
                ud.gameObject.transform.localPosition = NewRandomPoint();
                ud.gameObject.transform.localScale    = new Vector3(1.0f, 1.0f, 1.0f);
                ud.gameObject.transform.localRotation = Quaternion.Euler(0.0f, Random.Range(0.0f, 360.0f), 0.0f);
                ud.gameObject.transform.parent        = m_instRoot.transform;
                ud.SwapOut();
                m_quadtree.Receive(ud);
            }
        }

        return(true);
    }
Beispiel #2
0
    public bool Init()
    {
        UTestPrototypes.Init();

        m_instRoot = GameObject.Find("Instances");
        if (m_instRoot == null)
        {
            return(false);
        }

        m_metalod = new UMetaLod();
        for (int i = 0; i < 3000; i++)
        {
            MetaLodTargetGameObject target = UTestPrototypes.NewRandom();
            if (target != null)
            {
                target.gameObject.transform.localPosition = NewRandomPoint();
                target.gameObject.transform.localScale    = new Vector3(1.0f, 1.0f, 1.0f);
                target.gameObject.transform.localRotation = Quaternion.Euler(0.0f, Random.Range(0.0f, 360.0f), 0.0f);
                target.gameObject.transform.parent        = m_instRoot.transform;
                m_metalod.AddTarget(target);
            }
        }

        return(true);
    }