Как я могу получить ссылку на сценарий из второго объекта, содержащегося в списке, принадлежащем этому сценарию?C#

Место общения программистов C#
Ответить Пред. темаСлед. тема
Гость
 Как я могу получить ссылку на сценарий из второго объекта, содержащегося в списке, принадлежащем этому сценарию?

Сообщение Гость »


У меня есть MonoBehaviour

Код: Выделить всё

Container
that has a list of a default class (which is serializable so that I can modify its fields in

Код: Выделить всё

Container
inspector) and an

Код: Выделить всё

Animator
.
In editor time, I'm editing the es in the list of my

Код: Выделить всё

Container
. How can I access the

Код: Выделить всё

Container
that contains the I'm editing (inside the code)?
Basically I want to have a function inside that returns all animations from the animator stored in the

Код: Выделить всё

Container
.
I don't want to create a field in to store the reference for its

Код: Выделить всё

Container
but I don't mind using reflection or whatever it takes to access this Animator from the

Код: Выделить всё

Container
.
This is only needed when I'm editing the inspector of

Код: Выделить всё

Container
so it will be the current thing shown in the inspector, in case that helps.


Источник: https://stackoverflow.com/questions/781 ... ntained-in
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «C#»