コード例 #1
0
        private void ScaleSelectedItem(ObjectManipulator m, float delta)
        {
            ManipulatableObject componentInParent             = objectManipulationInputController.CurrentlySelectedObject.GetComponentInParent <ManipulatableObject>();
            Dictionary <int, DecorationDefinition> dictionary = Service.Get <IGameData>().Get <Dictionary <int, DecorationDefinition> >();

            if (dictionary.ContainsKey(componentInParent.DefinitionId))
            {
                DecorationDefinition decorationDefinition = dictionary[componentInParent.DefinitionId];
                float num = m.Scale + delta;
                if (num >= decorationDefinition.MinScale && num <= decorationDefinition.MaxScale)
                {
                    m.ScaleTo(num);
                }
            }
        }
コード例 #2
0
        public void OnScaleSliderChanged(float value)
        {
            if (!(objectManipulationInputController.CurrentlySelectedObject != null))
            {
                return;
            }
            ObjectManipulator componentInParent = objectManipulationInputController.CurrentlySelectedObject.GetComponentInParent <ObjectManipulator>();

            if (!(componentInParent != null))
            {
                return;
            }
            ManipulatableObject componentInParent2            = objectManipulationInputController.CurrentlySelectedObject.GetComponentInParent <ManipulatableObject>();
            Dictionary <int, DecorationDefinition> dictionary = Service.Get <IGameData>().Get <Dictionary <int, DecorationDefinition> >();

            if (dictionary.ContainsKey(componentInParent2.DefinitionId))
            {
                DecorationDefinition decorationDefinition = dictionary[componentInParent2.DefinitionId];
                if (value >= decorationDefinition.MinScale && value <= decorationDefinition.MaxScale)
                {
                    componentInParent.ScaleTo(value);
                }
            }
        }