Ejemplo n.º 1
0
    public static void Pool(SgtCloudsphereModel model)
    {
        if (model != null)
        {
            model.Cloudsphere = null;

            SgtComponentPool <SgtCloudsphereModel> .Add(model);
        }
    }
    public static void Pool(SgtCloudsphereModel model)
    {
        if (model != null)
        {
            model.Cloudsphere = null;

            SgtComponentPool<SgtCloudsphereModel>.Add(model);
        }
    }
    public static void MarkForDestruction(SgtCloudsphereModel model)
    {
        if (model != null)
        {
            model.Cloudsphere = null;

            model.gameObject.SetActive(true);
        }
    }
Ejemplo n.º 4
0
	public static void MarkForDestruction(SgtCloudsphereModel model)
	{
		if (model != null)
		{
			model.Cloudsphere = null;
			
			model.gameObject.SetActive(true);
		}
	}
    protected virtual void OnDestroy()
    {
        SgtHelper.Destroy(material);

        for (var i = models.Count - 1; i >= 0; i--)
        {
            SgtCloudsphereModel.MarkForDestruction(models[i]);
        }

        models.Clear();
    }
Ejemplo n.º 6
0
    protected virtual void OnDestroy()
    {
        if (Models != null)
        {
            for (var i = Models.Count - 1; i >= 0; i--)
            {
                SgtCloudsphereModel.MarkForDestruction(Models[i]);
            }
        }

        SgtHelper.Destroy(Material);
    }
    private void UpdateModels()
    {
        models.RemoveAll(m => m == null);

        if (Meshes.Count != models.Count)
        {
            SgtHelper.ResizeArrayTo(ref models, Meshes.Count, i => SgtCloudsphereModel.Create(this), m => SgtCloudsphereModel.Pool(m));
        }

        var scale = SgtHelper.Divide(Radius, MeshRadius);

        for (var i = Meshes.Count - 1; i >= 0; i--)
        {
            models[i].ManualUpdate(Meshes[i], material, scale);
        }
    }