Esempio n. 1
0
        private static IHeapStorage CreateHeapStorage(UdonBehaviour behaviour)
        {
            if (EditorApplication.isPlaying && !UsbSerializationContext.UseHeapSerialization)
            {
                UdonHeapStorageInterface heapStorageInterface = new UdonHeapStorageInterface(behaviour);

                return(heapStorageInterface.IsValid ? heapStorageInterface : null);
            }

            return(new UdonVariableStorageInterface(behaviour));
        }
        static IHeapStorage CreateHeapStorage(UdonBehaviour behaviour)
        {
            if (EditorApplication.isPlaying)
            {
                UdonHeapStorageInterface heapStorageInterface = new UdonHeapStorageInterface(behaviour);

                if (heapStorageInterface.IsValid)
                {
                    return(heapStorageInterface);
                }
                else
                {
                    return(null);
                }
            }
            else
            {
                return(new UdonVariableStorageInterface(behaviour));
            }
        }