Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by harutaka3 · Feb 06, 2018 at 08:07 PM · unity 5transformvector3inspector

I want to paste Vector 3 copied by Inspector in the form of Vector 3 (x, y, z) 【InspectorでコピーしたVector3を、Vector3(x,y,z)という形でペーストしたい】

I know that you can paste a Trasform by right-clicking Transform in the Inspector, pressing Copy Component, right-clicking the Transform of another object and pressing "Paste Component Values".

So, how do you convert Transform data copied by Inspector to text format and paste it? Copy x of Position of Transform, paste it on development tool, copy y of Transform's Position, paste it on the development tool, copy z of Transform's Position, paste it on the development tool, and apply same for Rotation It takes time and effort to do it to · · · ·. If possible, I want to copy Transform in Inspector and paste it so that it becomes Vector 3 (Position.x, Position.y, Position.z), Vector 3 (Rotation.xRotation.y, Rotation.z).

What I came up with was converting clipboard data to text format, but is that possible? Is there another way? Anything is okay, so please let me know. Thank you. The usage environment is Unity 5.4.0 f 3.

///////////google translate////////////

InspectorでTransformを右クリックして「Copy Component」を押せばTransformをコピーできて、他のオブジェクトのTransformを右クリックして「Paste Component Values」を押せばTrasformをペーストできることは知っています。

では、InspectorでコピーしたTransformのデータをテキスト形式に変換してペーストするにはどうすればいいのでしょうか? TransformのPositionのxをコピーして開発ツールに貼り付け、TransformのPositionのyをコピーして開発ツールに貼り付け、TransformのPositionのzをコピーして開発ツールに貼り付け、そしてRotationに関しても同様に・・・としていくのは手間がかかりすぎます。 できればInspectorでTransformをコピーして、ペーストするとVector3(Position.x,Position.y,Position.z),Vector3(Rotation.xRotation.y,Rotation.z)となるようにしたいです。

思いついたのはクリップボードのデータをテキスト形式に変換しておくことですが、そんなことは可能なのでしょうか?また、別の方法はありますか?どんなことでもいいので、是非教えてください。 よろしくお願いします。 利用環境はUnity5.4.0f3です。

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by MacDx · Feb 06, 2018 at 11:39 PM

What I came up with was converting clipboard data to text format, but is that possible

Yes it is possible. Here's how to do it:

1) Go to player settings > Other settings tab > Configuration section > Api Compatibility Level and change it to .NET 2.0 (Instead of the default .NET 2.0 Subset).

2) You will need the System.Windows.Form.dll file. Be careful here, there probably are many versions of this dll in your system. The one you will need will be inside your Unity installation folder, under Editor/Data/Mono/lib/mono/2.0. Once you located the file, create a Plugin folder in your project and paste this file. (The plugin folder should be of course, under the Assets folder).

3) Create an editor folder in your project (if you don't have one already) and create an editor script like this:

 using System;
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEditor;
 
 public class EditorExtensions 
 {
     [MenuItem("CONTEXT/Transform/Copy Transform to clipboard")]
     private static void CopyTransformToClipboard()
     {
         Debug.Log("Copy position to clipboard");
         Vector3 position = Selection.activeTransform.position;
         Vector3 rotation = Selection.activeTransform.rotation.eulerAngles;
         string vectorString = String.Format("Vector3({0},{1},{2})",position.x.ToString(),position.y.ToString(),position.z.ToString());
         vectorString += String.Format(",Vector3({0},{1},{2})",rotation.x.ToString(),rotation.y.ToString(),rotation.z.ToString());
         System.Windows.Forms.Clipboard.SetText(vectorString);
     }
 }

This will paste whatever data the transform has into the clipboard so you can do Ctrl + V and paste the data where you want, like a text editor. Hope this helps!

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image MacDx · Feb 07, 2018 at 12:01 AM 0
Share

Here's a quick demonstration of it:

https://imgur.com/a/z9rf$$anonymous$$

avatar image harutaka3 · Feb 07, 2018 at 03:17 AM 0
Share

Thanks to you, all my troubles have been solved. I am impressed now. Thank you so much for your help!

あなたのおかげで、私の悩みは全て解決しました。 私は今感動しています。 助けてくれて本当にありがとうございます!

avatar image roshan090 · Jun 02, 2020 at 05:57 AM 0
Share

You just made my day :)

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

225 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to move objects away from screen 1 Answer

Stupid question but I have to figure out 0 Answers

Why is this code in the script not stopping the rotation of the Gameobject? 0 Answers

How would someone go about creating multiple triggers in one script 0 Answers

Transform.position not working- want to clamp object within confines of screen 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges