### Setup and Prerequisites for Scriptable Sheets Source: https://context7.com/lunawolfstudios/scriptablesheetsdocs/llms.txt Lists required Unity packages and how to open the Scriptable Sheets window and settings. It also recommends adding UserSettings/ to .gitignore. ```plaintext // Required Unity packages (add via Package Manager or manifest.json): // - com.unity.nuget.newtonsoft-json // - com.unity.test-framework // Open Scriptable Sheets: // Unity Menu → Window → Scriptable Sheets // Open Settings: // Unity Menu → Edit → Project Settings → Preferences → Scriptable Sheets // OR right-click the Scriptable Sheets window title → "Open Settings Window" // Recommended: add UserSettings/ to .gitignore // UserSettings/ ``` -------------------------------- ### Exporting to JSON Example Source: https://context7.com/lunawolfstudios/scriptablesheetsdocs/llms.txt Instructions for exporting table data to JSON files in either Flat or Hierarchy format. Flat JSON is recommended for re-importing. ```json // Flat JSON export (recommended for re-importing): // Right-click window title → "Copy Json" // OR Toolbar → "Save to Disk" → change filename extension to .json // Example Flat JSON output: [ { "m_Name": "Warrior", "health": "150", "speed": "3.5", "damage.minDamage": "10", "damage.maxDamage": "25", "damage.type": "Physical" }, { "m_Name": "Mage", "health": "80", "speed": "4.0", "damage.minDamage": "30", "damage.maxDamage": "60", "damage.type": "Fire" } ] // Hierarchy JSON export (full object structure): // Settings → Data Transfer → Json Format = Hierarchy // Toolbar → "Save to Disk" → units_hierarchy.json // Note: Visible Columns Only is ignored for Hierarchy format. // Re-importing Flat JSON: // Toolbar → "Import File" → select the .json file // Array size must match — update the size property in both // Scriptable Sheets and the file before importing. ``` -------------------------------- ### Paste Pad Workflow Example Source: https://context7.com/lunawolfstudios/scriptablesheetsdocs/llms.txt Use Paste Pad to edit column data before pasting it back into Scriptable Sheets. Content is not persisted between sessions. ```plaintext // Open: Toolbar → "New Paste Pad" button OR Context Menu → "New Paste Pad Window" // Multiple Paste Pad windows can be open simultaneously. // Paste Pad content is NOT persisted between Unity sessions. // Workflow example — edit a column of values before pasting: // 1. In Scriptable Sheets: focus the "health" column → Toolbar → "Copy Column to Clipboard" // 2. Open Paste Pad → paste clipboard content // 150 // 80 // 100 // 3. Edit values directly in Paste Pad // 200 // 90 // 120 // 4. Select all text in Paste Pad → copy // 5. In Scriptable Sheets: focus the first health cell → Toolbar → "Smart Paste" // Values are distributed down the column automatically. // Paste Pad context menu (right-click): // Clear — clears all text // Copy — copies all text to clipboard // New — opens another Paste Pad window // Save — saves text to a file // Word Wrap — toggles word wrap ``` -------------------------------- ### Importing a CSV File Example Source: https://context7.com/lunawolfstudios/scriptablesheetsdocs/llms.txt Steps to import data from a CSV file into ScriptableObject instances. Ensure target ScriptableObjects are created first, as import does not create new assets. ```text // Prerequisites: create the target ScriptableObjects first — Scriptable Sheets // will NOT create new assets on import. // CSV file: Assets/Data/units.csv Name,health,speed,damage.minDamage,damage.maxDamage,damage.type Warrior,150,3.5,10,25,Physical Mage,80,4.0,30,60,Fire Rogue,100,5.5,15,35,Physical // Steps: // 1. Open Scriptable Sheets → select UnitData type // 2. Verify Data Transfer Settings: // Headers = true, Page Rows Only = false, Visible Columns Only = false // Column Delim = , (comma) // 3. Toolbar → "Import File" → select units.csv // Scriptable Sheets auto-detects .csv extension → sets Column Delim to comma // For TSV (Google Sheets default copy): // Column Delim = \t (tab) // Toolbar → "Import File" → select units.tsv ``` -------------------------------- ### Object Naming on Batch Create in Scriptable Sheets Source: https://context7.com/lunawolfstudios/scriptablesheetsdocs/llms.txt Configures auto-naming for assets during batch creation using variable expansion. Shows examples of using {t}, {i}, prefixes, suffixes, and index padding. ```plaintext // Settings → Object Management New Object Name: Unit_{t}_{i} {t} → replaced with the type name (e.g. "UnitData") {i} → replaced with the index (e.g. "001") New Object Prefix: Hero_ New Object Suffix: _v1 Starting Index: 1 Index Padding: 3 // produces 001, 002, 003 … // Example result for 3 new UnitData assets: // Hero_Unit_UnitData_001_v1.asset // Hero_Unit_UnitData_002_v1.asset // Hero_Unit_UnitData_003_v1.asset ``` -------------------------------- ### Advanced Search Filtering with Prefix Expressions Source: https://context7.com/lunawolfstudios/scriptablesheetsdocs/llms.txt Filter assets by GUID, asset path, or serialized property values using various operators and prefixes. Ensure 'Use String Enums' is enabled for enum property filtering. ```text // Filter by GUID (prefix: g: or guid:) guid:f1a42 ``` ```text // Filter by asset path (prefix: ap:, path:, or assetpath:) path:Assets/Data/Units/ ``` ```text // Filter by property value (prefix: p:, prop:, or property:) // Syntax: p: p:health>50 // health greater than 50 p:health>=100 // health greater than or equal to 100 p:damage.type==Fire // nested enum equals Fire (Use String Enums must be ON) p:unitName~=Warrior // name contains "Warrior" p:unitName!~Goblin // name does not contain "Goblin" p:weapon=? // weapon reference is null p:speed!=1.5 // speed not equal to 1.5 prop:myColor==FF0000 // color equals red (hex) ``` ```text // Filter Operations: // = or == equals // != not equals // > greater than // < less than // >= greater than or equal to // <= less than or equal to // ~= or =~ contains // !~ or ~! does not contain ``` ```text // Tip: right-click a column header → "Filter by property" to auto-insert the property path into the search bar. ``` -------------------------------- ### Import Scriptable Sheets Samples Source: https://context7.com/lunawolfstudios/scriptablesheetsdocs/llms.txt Instructions on how to import sample projects using the Unity Package Manager. This is the first step to exploring the provided samples. ```csharp // Import samples: // Unity Menu → Window → Package Manager → LWS Scriptable Sheets → Samples → Import ``` -------------------------------- ### RPG Sample Pattern Source: https://context7.com/lunawolfstudios/scriptablesheetsdocs/llms.txt Illustrates a common pattern in RPG development where UnitData references WeaponData, using separate ScriptableObjects for performance. This sample showcases Unity Object references and various serialized property types. ```csharp // UnitData → references WeaponData (separate SO for performance) // demonstrates Unity Object references and multiple serialized property types ``` -------------------------------- ### Optimize Workload and Performance Settings Source: https://context7.com/lunawolfstudios/scriptablesheetsdocs/llms.txt Adjust performance settings for large projects. Disable auto-save and auto-scan, and enable virtualization for better responsiveness. Tune iteration and cell limits as needed. ```csharp // Settings → Workload Auto Save: false // disable for better performance; save manually Auto Scan: false // disable; use Rescan button manually Auto Update: true // sync changes from Inspector in real time Virtualization: true // only render cells in the visible scroll area Debug: false Max Iterations: 3000 // properties iterated per column layout (×1000) // lower = faster; raise only for large arrays Max Visible Cells: 5000 // total cell cap for performance Rows Per Page: 50 // max rows per page Visible Column Limit: 100 // max columns rendered at once // Settings → User Interface (performance-related) Show Arrays: false // disable to skip array columns entirely Show Children: false // disable to hide nested fields Override Array Size: false // disable to avoid scanning all objects for max array size Best Fit Array Size: false // disable to skip scanning all objects for largest array // Tips: // - Use pagination for large datasets (disable "Page Rows Only" only at export time) // - Hide unused columns via right-click → "Hide Column" // - Shrink the window to reduce cells rendered per repaint // - Move large arrays into separate ScriptableObjects referenced by a parent SO ``` -------------------------------- ### Collections Sample Pattern Source: https://context7.com/lunawolfstudios/scriptablesheetsdocs/llms.txt Demonstrates wrapping large arrays in dedicated ScriptableObjects, such as StringCollection extending ScriptableCollection. This pattern is useful for referencing collections from a parent SO instead of embedding large arrays directly, optimizing performance. ```csharp // e.g. StringCollection extends ScriptableCollection // reference it from a parent SO instead of embedding the array directly ``` -------------------------------- ### Customize User Interface Settings Source: https://context7.com/lunawolfstudios/scriptablesheetsdocs/llms.txt Configure the table's appearance and navigation. Customize header formats, row height, and visibility of asset previews, indices, and paths. Adjust table navigation behavior. ```csharp // Settings → User Interface Header Format: Default — Unity's default display names (e.g. "Health") Friendly — display name + property path alias (e.g. "Health (health)") Advanced — raw property path (e.g. "health") Row Line Height: 2 // rows span 2 text lines; good for multiline strings Show Asset Previews: true // show texture/material/model thumbnails Asset Preview Scale Mode: Scale To Fit // letterbox; preserves aspect ratio Scale And Crop // fills cell; may crop edges Stretch To Fill // fills cell; ignores aspect ratio Show Row Index: true Show Column Index: true Show Asset Path: true // read-only column showing Assets/... path Show GUID: false Show Read-only: false // show read-only backing fields Lock Names: true // prevent direct name edits in the table // Table Navigation Auto Scroll: true // scroll view follows keyboard navigation Auto Select: true // clicking a cell selects it in the Inspector Highlight Row: true Highlight Column: true Highlight Alpha: 0.3 // Keyboard shortcuts in the table: // Tab / Shift+Tab → next / previous cell // Arrow keys → navigate cells // Enter → enter edit mode; Enter again to confirm // Ctrl/Cmd + Enter → insert newline in text field // Esc → cancel edit ``` -------------------------------- ### Configure Google Sheets Importer Source: https://context7.com/lunawolfstudios/scriptablesheetsdocs/llms.txt Steps to set up a Google Sheets Importer asset. Ensure the sheet is shared publicly and configure the importer with the correct Sheet ID and Sheet Name. ```csharp // Step 1: Create an importer asset // Project window → right-click → Create → Scriptable Sheets → Google Sheets Importer // Place it inside an Editor-only folder (e.g. Assets/Editor/Importers/) // Step 2: Configure the importer asset in the Inspector: // // Mono Script: [drag the UnitData MonoScript here] // Full Type Name: (leave blank if Mono Script is set) // Main Asset: (optional — for Sub Asset grouping) // Window Name: (optional — target a specific named Sheet window) // Sheet ID: 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms // (from URL: docs.google.com/spreadsheets/d/SHEET_ID) // Sheet Name: Units ← case-sensitive, must match tab name exactly // // Google Sheet share setting must be: "Anyone with the link" (Viewer) // Step 3: Register the importer // Scriptable Sheets Settings → Google Sheets Importers → click "Scan" // Step 4: Import // Open Scriptable Sheets → select UnitData → ensure Objects exist // Review Data Transfer Settings (Headers=true, Escape Option=Repeat for GSheets) // Toolbar → "Import CSV from Google Sheets" // CSV format is used; double quotes are the wrap character. ``` -------------------------------- ### Scriptable Sheets Scan Options Configuration Source: https://context7.com/lunawolfstudios/scriptablesheetsdocs/llms.txt Explains settings for controlling how Scriptable Sheets discovers asset types and instances. Includes options for Scan Option, Scan Path Option, and exclusions for paths and types. ```plaintext // Settings → Object Management → Scanning Scan Option: Default — finds types based on existing asset instances in the project Assembly — scans all assemblies; finds types with no instances yet (requires [System.Serializable] on custom types) Scan Path Option: Default — scan a specific folder (Assets root by default) Assets — scan the entire Assets folder Packages — scan the Packages folder only All — scan both Assets and Packages // Exclude specific folders from scanning: Excluded Paths: Assets/ThirdParty/ Packages/com.example.oldpackage/ // Exclude specific types: Excluded Full Type Names: MyNamespace.InternalScriptableObject UnityEngine.Timeline.TrackAsset // After changing exclusions → click Rescan on the toolbar ``` -------------------------------- ### Data Transfer Settings Configuration Source: https://context7.com/lunawolfstudios/scriptablesheetsdocs/llms.txt Configure import/export settings including delimiters, wrapping, headers, and JSON format. These settings affect how data is read from and written to files. ```text // Settings → Data Transfer Headers: true // first row is treated as header on import Smart Paste: true // distributes clipboard data across cells Page Rows Only: false // include all pages on copy/import Visible Columns Only: false // include hidden columns on copy/import Remove Empty Rows: true Use String Enums: true // serialize enums as "Fire" instead of 2 Ignore Case: true // case-insensitive enum deserialization ``` ```text Row Delim: \n // newline separates rows Column Delim: , // comma separates columns (CSV) \t // tab separates columns (TSV / Google Sheets default) ``` ```text Wrap Option: Double Quotes // wraps cell values in "..." Escape Option: Repeat // "Hello""World" ← use for Google Sheets Backslash // "Hello\"World" Custom // define your own escape sequence ``` ```text Json Format: Flat // { "health": "100", "damage.minDamage": "10" } // recommended for round-tripping with flat files Hierarchy // full nested Unity object structure; ignores visible columns // recommended for runtime processing ``` -------------------------------- ### Column Context Menu Actions Source: https://context7.com/lunawolfstudios/scriptablesheetsdocs/llms.txt Access quick per-column actions by right-clicking a column header. Options include docking, hiding, copying, and filtering. ```plaintext // Right-click a column header to access: Dock Column — pins Actions or Name column so it stays visible during horizontal scroll — keyboard navigation still follows normal column order Hide Column — hides the column from the table view — re-enable via Context Menu → "Edit Column Visibility" — or Toolbar → "Show Columns" to reveal all hidden columns at once Copy Column — copies the full column content to clipboard using current Data Transfer settings — equivalent to focusing the column and pressing the "Copy Column" toolbar button Copy Property Path — copies the full serialized property path to clipboard — e.g. "damage.minDamage" — useful for building advanced search filters manually Filter by property — clears the search bar and inserts: p:damage.minDamage — instantly filters the table to Objects matching that property ``` -------------------------------- ### Managing Sub Assets and Prefab Components Source: https://context7.com/lunawolfstudios/scriptablesheetsdocs/llms.txt Directly edit Sub Assets within ScriptableObjects and Components on Prefabs from the table view. Configure settings for filtering and creation. ```plaintext // Sub Assets // Settings → User Interface → Sub Asset Filters = true // In the Scriptable Sheets window: a dropdown appears listing Main Assets // that contain the selected ScriptableObject Sub Asset type. // Filter by Main Asset to view/edit only its Sub Assets. // Creating a Sub Asset on import: // Settings → Object Management → Default Main Asset = [drag a Main Asset here] // New ScriptableObjects will be created as Sub Assets of that Main Asset. // Prefab Components // Asset Type dropdown (top-left) → select "Prefab" // Object Type dropdown → select a Component type (e.g. Rigidbody, Transform) // Settings → Object Management → Scanning → Root Prefabs Only = true // (disable to also scan nested Prefab objects; enable "Show Asset Path" for clarity) // Example: view all Rigidbody components on Prefabs // Asset Type: Prefab // Object Type: Rigidbody // Columns: mass, drag, angularDrag, useGravity, isKinematic, ... // Edit values inline; changes save to each Prefab asset. ``` -------------------------------- ### Experimental Rendering Overrides Source: https://context7.com/lunawolfstudios/scriptablesheetsdocs/llms.txt Override default cell rendering for specific serialized property types using custom property drawers. Use with caution as it may disrupt table layout. ```plaintext // Settings → Experimental → Rendering Overrides // Add SerializedPropertyType entries to override rendering. // WARNING: may disrupt table layout. Use with caution. // Example: force a custom drawer for all Integer properties // Add entry: SerializedPropertyType.Integer // This allows attributes like [Range], [Header], etc. to render // in the table for overridden types. // All other types continue using Scriptable Sheets' built-in renderers. ``` -------------------------------- ### Define ScriptableObject for Scriptable Sheets Source: https://context7.com/lunawolfstudios/scriptablesheetsdocs/llms.txt Defines a serializable ScriptableObject `UnitData` with various field types, including custom classes, enums, and Unity Object references. Use `[System.Serializable]` on custom types for Assembly scanning. ```csharp using UnityEngine; [CreateAssetMenu(fileName = "NewUnit", menuName = "RPG/Unit")] public class UnitData : ScriptableObject { public string unitName; public int health; public float speed; public DamageStats damage; public WeaponData weapon; // Object reference to another ScriptableObject public AudioClip attackSound; // Unity Object reference public string[] abilities; // Array — shown as individual columns } [System.Serializable] public class DamageStats { public int minDamage; public int maxDamage; public DamageType type; // Enum } public enum DamageType { Physical, Fire, Ice, Lightning } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.