Skip to content

Conversation

@mirapichai
Copy link
Owner

@mirapichai mirapichai commented May 28, 2025

Object Translator Editor Tool

Summary

This PR contains the Object Translator component. It also includes several different implementations for how the Object Translator component can be run (via Context Menu, custom Inspector button, etc).

What's Included

ObjectTranslator.cs

  • The core MonoBehaviour component script that handles object translation functionality
  • Implements Context Menu and Context Menu Item to run the component
  • To use, attach the component to a GameObject, specify translation units for X, Y, and/or Z in the Inspector, and run via the Context Menu or Context Menu Item. When run, the object will translate by the specified units.

ObjectTranslatorInspector.cs

  • Extends the Inspector view for the component with a button that will run the object translation.

ObjectTranslatorEditorWindow.cs

  • Implements a custom Editor Window using UGUI (accessible from Tools > Object Translator UGUI)
  • Lists all objects that have the ObjectTranslator component
  • Allows the component to be run on all objects or per object

ObjectTranslatorEditorWindowUITK.cs

  • Implements a custom Editor Window using UI Toolkit (accessible from Tools > Object Translator UITK)
  • Lists all objects that have the ObjectTranslator component
  • Allows the component to be run on all objects, per object, or on multi-selected objects

ObjectTranslatorStylesheet.uss

  • Stylesheet for the ObjectTranslatorEditorWindowUITK.cs

ObjectTranslatorVisualTree.uxml

  • UI for ObjectTranslatorEditorWindowUITK.cs

Testing

This code has basic functionality working, but because the scripts and this PR are for learning purposes, it has not been thoroughly tested :)

@mirapichai mirapichai marked this pull request as draft May 28, 2025 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants