Exemple #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, "Anima Examples", "AnimaExamples")) throw new ArgumentException("Anima failed to initialize!");

            // Add parts
            m_part_core = m_anima.AddPart(null, @"AnimaExamples\ModelCore");
            m_part_topcap = m_anima.AddPart(m_part_core, @"animaexamples\TopCap");
            m_part_bottomcap = m_anima.AddPart(m_part_core, @"animaexamples\BottomCap");

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

            // Play sequences
            m_anima.Play(Anima.Playback.LOOP);

            // Update each frame, note this may not work for all object's types!
            Entity.NeedsUpdate |= MyEntityUpdateEnum.EACH_FRAME;
        }
Exemple #2
0
        // Your block initialization
        public void BlockInit()
        {
            // ( Your initialization code here! )

            // 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, "Anima Examples", "AnimaExamples")) throw new ArgumentException("Anima failed to initialize!");

            // Add parts
            m_part = m_anima.AddPart(null, @"AnimaExamples\ModelCube");

            // Assign sequences
            m_part.Sequence = Seq_Cube.Adquire();

            // Play sequences
            m_part.Play(Anima.Playback.LOOP);
        }