BattlehubCode / RTE_Docs

This is a repository for Runtime Editor documentation, discussion and tracking features and issues.
https://assetstore.unity.com/packages/tools/modeling/runtime-editor-64806
11 stars 1 forks source link

How to select an object by clicking a button #119

Closed weilifang25 closed 2 months ago

weilifang25 commented 2 months ago

Can you help me with another thing? I am currently selecting objects by clicking them. I want to select objects by clicking buttons. Can you provide me with the method?(My object is bound to the button)

BattlehubCode commented 2 months ago

Yes, here is the example

using Battlehub.RTCommon;
using Battlehub.RTHandles;
using UnityEngine;

[SerializeField]
private GameObject m_target;

var editor = IOC.Resolve<IRTE>();
editor.Selection.activeGameObject = m_target;
weilifang25 commented 2 months ago

Thank you, I have done it. Do you have a complete document? I can't bother you if I have any questions.