Пример #1
0
        // Your block initialization
        public void BlockInit()
        {
            // No point to run this script if is a dedicated server because there's no graphics
            if (Anima.DedicatedServer)
            {
                return;
            }

            // Create the main Anima class
            m_anima = new Anima();

            // Initialize Anima
            if (!m_anima.Init(Entity as MyEntity, "Holographic Radar", "Holo"))
            {
                throw new ArgumentException("Anima failed to initialize!");
            }

            // Add parts
            m_part_1 = m_anima.AddPart(null, @"Radar\Radar_Part1");
            m_part_2 = m_anima.AddPart(m_part_1, @"Radar\Radar_Part2");
            m_part_3 = m_anima.AddPart(m_part_2, @"Radar\Radar_Part3");

            // Assign sequences
            coreFunctionality(m_part_1);
            m_part_1.OnComplete = coreFunctionality;

            // Play sequences
            m_part_1.Play(Anima.Playback.LOOP);
            m_part_2.Play(Anima.Playback.LOOP);
            m_part_3.Play(Anima.Playback.LOOP);

            // Update each frame, note this may not work for all object's types!
            Entity.NeedsUpdate |= MyEntityUpdateEnum.EACH_FRAME;
        }