Example #1
0
 protected void OnEnable()
 {
     sfMeshType               = MelGraphicsSettings.preset.particleMeshSf;
     sfMesh                   = MeshStorage.GetMesh(sfMeshType, MelGraphicsSettings.preset.maxAtomsInParticle);
     flatMeshType             = MelGraphicsSettings.preset.particleMeshFlat;
     flatMesh                 = MeshStorage.GetMesh(MelGraphicsSettings.preset.particleMeshFlat, MelGraphicsSettings.preset.maxAtomsInParticle);
     accurateDepthInParticles = MelGraphicsSettings.preset.accurateDepthInParticles;
 }
Example #2
0
        // TODO: Async init
        public BallsListBucket(BallsRendererSettings settings, int _size, Transform parent)
            : base(settings, parent)
        {
            size       = _size;
            transforms = new Transform[size];
            materials  = new Material[size];
            meshes     = new MeshFilter[size];

            Mesh atomMesh = MeshStorage.GetMesh(MeshStorage.MeshType.TrueSphere, 1);

            for (int i = 0; i < size; i++)
            {
                GameObject go = GameObject.Instantiate(settings.ballObjectPrototype, thisTransform);
                go.name = "ball_" + i;
                go.GetComponent <MeshFilter>().sharedMesh = atomMesh;

                transforms[i] = go.transform;
                materials[i]  = go.GetComponent <MeshRenderer>().material;
                meshes[i]     = go.GetComponent <MeshFilter>();

                materials[i].SetFloat(billboardExtrudeFactorId, billboardScaleFactor);
            }
        }