コード例 #1
0
    public BIWEntity DuplicateEntity(BIWEntity entityToDuplicate)
    {
        IDCLEntity entity = SceneUtils.DuplicateEntity(sceneToEdit, entityToDuplicate.rootEntity);

        //Note: If the entity contains the name component or DCLLockedOnEdit, we don't want to copy them
        entity.RemoveSharedComponent(typeof(DCLName), false);
        entity.RemoveSharedComponent(typeof(DCLLockedOnEdit), false);

        BIWUtils.CopyGameObjectStatus(entityToDuplicate.rootEntity.gameObject, entity.gameObject, false, false);
        BIWEntity convertedEntity = SetupEntityToEdit(entity);

        NotifyEntityIsCreated(entity);
        EntityListChanged();
        return(convertedEntity);
    }
コード例 #2
0
ファイル: PBRMaterial.cs プロジェクト: useit015/explorer
        public override void AttachTo(IDCLEntity entity, System.Type overridenAttachedType = null)
        {
            if (attachedEntities.Contains(entity))
            {
                return;
            }

            entity.RemoveSharedComponent(typeof(BasicMaterial));
            base.AttachTo(entity);
        }
コード例 #3
0
        public virtual void DetachFrom(IDCLEntity entity, System.Type overridenAttachedType = null)
        {
            if (!attachedEntities.Contains(entity))
            {
                return;
            }

            entity.OnRemoved -= OnEntityRemoved;

            System.Type thisType = overridenAttachedType != null ? overridenAttachedType : GetType();
            entity.RemoveSharedComponent(thisType, false);

            attachedEntities.Remove(entity);

            OnDetach?.Invoke(entity);
        }