Inheritance: IClientAPI
Esempio n. 1
0
        // private void AddFileSystemObjects()
        // {
        //     DirectoryInfo dirInfo = new DirectoryInfo(".");

        //     float x = 0;
        //     float z = 0;

        //     foreach (FileInfo fileInfo in dirInfo.GetFiles())
        //     {
        //         Vector3 filePos = new Vector3(100 + x, 129, 27 + z);
        //         x = x + 2;
        //         if (x > 50)
        //         {
        //             x = 0;
        //             z = z + 2;
        //         }

        //         FileSystemObject fileObject = new FileSystemObject(m_scene, fileInfo, filePos);
        //         m_scene.AddNewSceneObject(fileObject, true);
        //     }
        // }

        private void AddAvatars()
        {
            for (int i = 0; i < 1; i++)
            {
                MyNpcCharacter m_character = new MyNpcCharacter(m_scene);
                m_scene.AddNewClient(m_character);
                m_scene.AgentCrossing(m_character.AgentId, Vector3.Zero, false);
            }

            List<ScenePresence> avatars = m_scene.GetAvatars();
            foreach (ScenePresence avatar in avatars)
            {
                avatar.AbsolutePosition =
                    new Vector3((float)Util.RandomClass.Next(100, 200), (float)Util.RandomClass.Next(30, 200), 2);
            }
        }
Esempio n. 2
0
        // private void AddFileSystemObjects()
        // {
        //     DirectoryInfo dirInfo = new DirectoryInfo(".");

        //     float x = 0;
        //     float z = 0;

        //     foreach (FileInfo fileInfo in dirInfo.GetFiles())
        //     {
        //         Vector3 filePos = new Vector3(100 + x, 129, 27 + z);
        //         x = x + 2;
        //         if (x > 50)
        //         {
        //             x = 0;
        //             z = z + 2;
        //         }

        //         FileSystemObject fileObject = new FileSystemObject(m_scene, fileInfo, filePos);
        //         m_scene.AddNewSceneObject(fileObject, true);
        //     }
        // }

        private void AddAvatars()
        {
            for (int i = 0; i < 1; i++)
            {
                MyNpcCharacter m_character = new MyNpcCharacter(m_scene);
                m_scene.AddNewClient(m_character);
                m_scene.AgentCrossing(m_character.AgentId, Vector3.Zero, false);
            }

            List <ScenePresence> avatars = m_scene.GetAvatars();

            foreach (ScenePresence avatar in avatars)
            {
                avatar.AbsolutePosition =
                    new Vector3((float)Util.RandomClass.Next(100, 200), (float)Util.RandomClass.Next(30, 200), 2);
            }
        }
        // private void AddFileSystemObjects()
        // {
        //     DirectoryInfo dirInfo = new DirectoryInfo(".");

        //     float x = 0;
        //     float z = 0;

        //     foreach (FileInfo fileInfo in dirInfo.GetFiles())
        //     {
        //         Vector3 filePos = new Vector3(100 + x, 129, 27 + z);
        //         x = x + 2;
        //         if (x > 50)
        //         {
        //             x = 0;
        //             z = z + 2;
        //         }

        //         FileSystemObject fileObject = new FileSystemObject(m_scene, fileInfo, filePos);
        //         m_scene.AddNewSceneObject(fileObject, true);
        //     }
        // }

        private void AddAvatars()
        {
            for (int i = 0; i < 1; i++)
            {
                MyNpcCharacter m_character = new MyNpcCharacter(m_scene);
                m_scene.AddNewClient(m_character);
                m_scene.AgentCrossing(m_character.AgentId, Vector3.Zero, false);
            }

            m_scene.ForEachScenePresence(delegate(ScenePresence sp)
            {
                if (!sp.IsChildAgent)
                {
                    sp.AbsolutePosition =
                        new Vector3((float)Util.RandomClass.Next(100, 200), (float)Util.RandomClass.Next(30, 200), 2);
                }
            });
        }
Esempio n. 4
0
        // private void AddFileSystemObjects()
        // {
        //     DirectoryInfo dirInfo = new DirectoryInfo(".");

        //     float x = 0;
        //     float z = 0;

        //     foreach (FileInfo fileInfo in dirInfo.GetFiles())
        //     {
        //         Vector3 filePos = new Vector3(100 + x, 129, 27 + z);
        //         x = x + 2;
        //         if (x > 50)
        //         {
        //             x = 0;
        //             z = z + 2;
        //         }

        //         FileSystemObject fileObject = new FileSystemObject(m_scene, fileInfo, filePos);
        //         m_scene.AddNewSceneObject(fileObject, true);
        //     }
        // }

        private void AddAvatars()
        {
            for (int i = 0; i < 1; i++)
            {
                MyNpcCharacter m_character = new MyNpcCharacter(m_scene);
                m_scene.AddNewClient(m_character);
                m_scene.AgentCrossing(m_character.AgentId, Vector3.Zero, false);
            }

            m_scene.ForEachScenePresence(delegate(ScenePresence sp)
            {
                if (!sp.IsChildAgent)
                    sp.AbsolutePosition =
                        new Vector3((float)Util.RandomClass.Next(100, 200), (float)Util.RandomClass.Next(30, 200), 2);
            });
        }