public sealed override void Create(UTinyEntityView view, Transform t)
        {
            UTinyEntity.Reference parentRef = UTinyEntity.Reference.None;
            if (t.parent)
            {
                parentRef = t.parent.GetComponent <UTinyEntityView>()?.EntityRef ?? UTinyEntity.Reference.None;
            }

            var graph = EntityGroupManager.GetSceneGraph(
                parentRef.Equals(UTinyEntity.Reference.None) ?
                EntityGroupManager.ActiveEntityGroup
                                        : (UTinyEntityGroup.Reference)parentRef.Dereference(Registry).EntityGroup);

            if (null == graph)
            {
                return;
            }

            var transform = new UTinyObject(Registry, GetMainTinyType());

            SyncTransform(t, transform);

            var entityNode = graph.CreateFromExisting(t, t.parent);
            var entity     = entityNode.Entity.Dereference(Registry);

            var tiny = entity.GetOrAddComponent(GetMainTinyType());

            tiny.CopyFrom(transform);

            BindingsHelper.RunBindings(entity, tiny);
        }
Пример #2
0
 bool IExcludeVisit <UTinyEntity.Reference> .ExcludeVisit(UTinyEntity.Reference value)
 {
     return(value.Equals(UTinyEntity.Reference.None));
 }