#There is the ISerialization interface
1 messages · Page 1 of 1 (latest)
i have no clue why it's happening.
I think because of the nature of Texture2dArray, unity decides to save it
It also happens with meshes for example
(which i have the same issue and need to find a way to delete it) but because they are UnityObjects they get always serialized and stored into the scene
That is patent nonsense. Nothing gets saved unless YOU tell it to. So if things are being saved it's because you have made it so
Wait, I want to be clear that im creating those assets in Editor Mode
If you still think that tho, just tried making a new project, added this script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[ExecuteAlways]
public class Test : MonoBehaviour
{
private Mesh mesh;
private Texture2DArray rry;
// Start is called before the first frame update
void OnEnable()
{
mesh = new Mesh();
mesh.name = "New Mesh";
rry = new Texture2DArray(10,10,1,TextureFormat.Alpha8, true);
rry.name = "New Text Test";
Debug.Log("mesh created");
var filter = GetComponent<MeshFilter>();
filter.sharedMesh = mesh;
}
}
and saving the scene and i got a "New Mesh" saved into the scene object. Not sure if shared mesh counts as making it so that it is saved?
what do you think [ExecuteAlways] does?
It's so it gets always executed, both in editor and play mode, no?
exactly, so if you do a New anything Unity object it get created in your scene
That's the whole point yeah
That's why I said