コード例 #1
0
        public override void Setup(ParcelScene scene, DecentralandEntity entity, UUIDComponent.Model model)
        {
            this.entity = entity;
            this.scene  = scene;

            if (model == null)
            {
                this.model = new OnPointerEvent.Model();
            }
            else
            {
                this.model = (OnPointerEvent.Model)model;
            }

            Initialize();

            entity.OnShapeUpdated -= OnComponentUpdated;
            entity.OnShapeUpdated += OnComponentUpdated;
        }
コード例 #2
0
ファイル: ParcelScene.cs プロジェクト: menduz/explorer
        // HACK: (Zak) will be removed when we separate each
        // uuid component as a different class id
        public UUIDComponent EntityUUIDComponentUpdate(DecentralandEntity entity, string type, UUIDComponent.Model model)
        {
            if (entity == null)
            {
                Debug.LogError($"Can't update the {type} uuid component of a nonexistent entity!", this);
                return(null);
            }

            if (!entity.uuidComponents.ContainsKey(type))
            {
                Debug.LogError($"Entity {entity.entityId} doesn't have a {type} uuid component to update!", this);
                return(null);
            }

            UUIDComponent targetComponent = entity.uuidComponents[type];

            targetComponent.Setup(this, entity, model);

            return(targetComponent);
        }