Beispiel #1
0
        public static void AdvDoor_MoveSpeed(MyAdvancedDoorDefinition advDoor, out float openTime, out float closeTime)
        {
            openTime  = 0;
            closeTime = 0;

            foreach (var seq in advDoor.OpeningSequence)
            {
                var moveTime = (seq.MaxOpen / seq.Speed);

                openTime  = Math.Max(openTime, seq.OpenDelay + moveTime);
                closeTime = Math.Max(closeTime, seq.CloseDelay + moveTime);
            }
        }
        byte linkSkip = 127; // link ASAP

        public override void Init(MyObjectBuilder_EntityBase objectBuilder)
        {
            block       = (MyAdvancedDoor)Entity;
            def         = (MyAdvancedDoorDefinition)((MyCubeBlock)block).BlockDefinition;
            NeedsUpdate = MyEntityUpdateEnum.EACH_FRAME;
        }