Ejemplo n.º 1
0
        private void MMessageBus_ChangeAvatarRequestHandler(object sender, ChangeAvatarEvent e)
        {
            MBuildingBlock bb = MBuildParts.GetBlock(e.TemplateID);

            if (bb == null)
            {
                Console.WriteLine("MSpawnHandler: Missing Template:" + e.TemplateID);
                return;
            }

            MSceneObject mo = (MSceneObject)MScene.ModelRoot.FindModuleByInstanceID(e.UserID);

            if (mo != null)
            {
                MMessageBus.DeleteRequest(this, mo);
            }

            MServerObject m = new MServerObject();

            m.InstanceID = e.UserID;
            m.TemplateID = e.TemplateID;
            m.OwnerID    = e.UserID;
            m.TextureID  = bb.MaterialID;
            m.Name       = Globals.UserAccount.UserName;
            MScene.Camera.CameraOffset = MassiveTools.VectorFromArray(bb.BoneOffset);
            m.Position = Globals.UserAccount.CurrentPosition;
            m.Rotation = MassiveTools.ArrayFromQuaterniond(Globals.Avatar.GetRotation());
            Spawn(m);
        }
Ejemplo n.º 2
0
        private void MMessageBus_AvatarChangedHandler(object sender, ChangeAvatarEvent e)
        {
            string sPath = Path.Combine(MFileSystem.AssetsPath, "Audio", "walking-in-snow-1.wav");

            WalkSound.Load(sPath, _avatar.Target);
            WalkSound.Loop = true;
        }
Ejemplo n.º 3
0
        private void MMessageBus_AvatarChangedHandler(object sender, ChangeAvatarEvent e)
        {
            AmbientSound = (MSound)Globals.Avatar.Target.FindModuleByName("ClimateSound");
            if (AmbientSound == null)
            {
                AmbientSound = new MSound("ClimateSound");
                Globals.Avatar.Target.Add(AmbientSound);
            }

            AmbientSound.Load(Path.Combine(MFileSystem.AssetsPath, "Audio", "ambiencem.wav"), Globals.Avatar.Target);
            AmbientSound.Loop   = true;
            AmbientSound.Volume = 0.15f;
            AmbientSound.Play((MAudioListener)MScene.Camera.FindModuleByType(EType.AudioListener));
        }
Ejemplo n.º 4
0
 private void MMessageBus_ChangeAvatarRequestHandler(object sender, ChangeAvatarEvent e)
 {
     Globals.UserAccount.AvatarID = e.TemplateID;
 }
Ejemplo n.º 5
0
 private void MMessageBus_AvatarChangedHandler(object sender, ChangeAvatarEvent e)
 {
     Initialize();
 }