Example #1
0
        override public void Copy(IMComponentModel o)
        {
            var o1 = o as TextBoxModel;

            if (o1 != null)
            {
                text = o1.text;
            }
        }
        override public void Copy(IMComponentModel o)
        {
            var o1 = o as ImageModel;

            if (o1 != null)
            {
                resource      = o1.resource;
                resourceScale = o1.resourceScale;
            }
        }
Example #3
0
        virtual public void Copy(IMComponentModel o)
        {
            targetPosition = o.targetPosition;
            hiddenPosition = o.hiddenPosition;

            targetRotation = o.targetRotation;
            hiddenRotation = o.hiddenRotation;

            targetScale = o.targetScale;
            hiddenScale = o.hiddenScale;
        }
Example #4
0
        public AbstractIMComponent InstantiateComponent(IMComponentModel model)
        {
            if (model == null)
            {
                Debug.LogWarning("Cannot create component for null model");
                return(null);
            }

            if (model is TextBoxModel)
            {
                var textbox = Instantiate(textPrefab) as TextBox;
                textbox.model.Copy(model);
            }
            else if (model is ThreeDItemModel)
            {
                var item = Instantiate(threeDPrefab);
                item.model.Copy(model);
            }

            Debug.LogWarning("Cannot create component for model: " + model.GetType());
            return(null);
        }