Esempio n. 1
0
        private static void CheckHingeBlock(BlockConfigModalParameters parameters, GameObject blockObject)
        {
            HingeBlock hingeBlockComponent = blockObject.GetComponent <HingeBlock>();

            if (hingeBlockComponent != null)
            {
                parameters.panelParametersList.Add(new HingeBlockConfigPanelParameters(hingeBlockComponent));
            }
        }
Esempio n. 2
0
        private static void CheckLimitControl(BlockConfigModalParameters parameters, GameObject blockObject)
        {
            LimitControl limitControl = blockObject.GetComponent <LimitControl>();

            if (limitControl != null)
            {
                parameters.panelParametersList.Add(new LimitBlockConfigPanelParameters(limitControl));
            }
        }
Esempio n. 3
0
        private static void CheckMotorControl(BlockConfigModalParameters parameters, GameObject blockObject)
        {
            MotorControl motorControl = blockObject.GetComponent <MotorControl>();

            if (motorControl != null)
            {
                parameters.panelParametersList.Add(new MotorBlockConfigPanelParameters(motorControl));
            }
        }
Esempio n. 4
0
        public static BlockConfigModalParameters GetBlockConfigModalParameters(Block block)
        {
            BlockConfigModalParameters parameters = new BlockConfigModalParameters();

            parameters.panelParametersList.Add(new BaseBlockConfigPanelParameters(block));

            GameObject blockObject = block.gameObject;

            CheckHingeBlock(parameters, blockObject);
            CheckMotorControl(parameters, blockObject);
            CheckLimitControl(parameters, blockObject);
            return(parameters);
        }
Esempio n. 5
0
        public override void Init(ModalParameters parameters)
        {
            panelList = new List <BlockConfigPanelController>();

            BlockConfigModalParameters blockConfigModalParameters = parameters as BlockConfigModalParameters;

            closeCallback = blockConfigModalParameters.closeCallback;
            foreach (BlockConfigPanelParameters panelParameter in blockConfigModalParameters.panelParametersList)
            {
                SpawnBlockConfigPanel(panelParameter);
            }

            base.Init(parameters);
        }