예제 #1
0
        protected override void preInitOnScene()
        {
            ammunitionModel = sceneMgr.CreateEntity("Torpedo" + ammunitionID.ToString(), "Torpedo.mesh");
            ammunitionNode  =
                sceneMgr.RootSceneNode.CreateChildSceneNode("Torpedo" + ammunitionID.ToString(),
                                                            hiddenPosition);

            Vector3 oVector = new Vector3(0, 0, -1);

            innerNode =
                ammunitionNode.CreateChildSceneNode("TorpedoInner" + ammunitionID.ToString(), new Vector3(0, 0, 0));
            innerNode.AttachObject(ammunitionModel);

            torpedoAnimation         = new ConstRotateNodeAnimation(innerNode, 75, oVector, "ConstRot");
            torpedoAnimation.Enabled = true;
            torpedoAnimation.Looped  = true;

            if (EngineConfig.DisplayingMinimap)
            {
                minimapItem =
                    new MinimapItem(ammunitionNode, framework.MinimapMgr, "Cube.mesh", ColourValue.White,
                                    ammunitionModel);
                minimapItem.ScaleOverride = new Vector2(4, 2);
                minimapItem.Refresh();
                minimapItem.Hide();
            }

            ammunitionNode.SetVisible(false);
            innerNode.SetVisible(false);
        }
예제 #2
0
        public virtual void Hide()
        {
            ammunitionNode.SetVisible(false);

            if (EngineConfig.DisplayingMinimap)
            {
                minimapItem.Hide();
            }
        }
예제 #3
0
        protected override void preInitOnScene()
        {
            ammunitionModel = sceneMgr.CreateEntity("Bomb" + ammunitionID.ToString(), "Bomb.mesh");
            ammunitionNode  =
                sceneMgr.RootSceneNode.CreateChildSceneNode("Bomb" + ammunitionID.ToString(),
                                                            hiddenPosition);
            ammunitionNode.AttachObject(ammunitionModel);
            ammunitionNode.SetVisible(false);


            if (EngineConfig.DisplayingMinimap)
            {
                minimapItem =
                    new MinimapItem(ammunitionNode, framework.MinimapMgr, "Cube.mesh", ColourValue.White,
                                    ammunitionModel);
                minimapItem.ScaleOverride = new Vector2(2, 4);
                minimapItem.Refresh();
                minimapItem.Hide();
            }
        }
예제 #4
0
        protected void preInitOnScene()
        {
            soldierModel = sceneMgr.CreateEntity("Soldier" + soldierID.ToString(), "Soldier.mesh");

            soldierNode =
                sceneMgr.RootSceneNode.CreateChildSceneNode("SoldierNode" + soldierID.ToString(),
                                                            new Vector3(-1000000, -1000000, 0));

            if (EngineConfig.SoundEnabled)
            {
                float rand = Math.RangeRandom(0.0f, 5.0f);
                if (rand >= 0 && rand < 1.0)
                {
                    dieSound = SoundManager3D.Instance.CreateSoundEntity(SoundManager3D.C_SOLDIER_DIE_1, soldierNode, false, false);
                    dieSound.SetBaseGain(3.5f);
                }
                else if (rand >= 1 && rand < 2.0)
                {
                    dieSound = SoundManager3D.Instance.CreateSoundEntity(SoundManager3D.C_SOLDIER_DIE_2, soldierNode, false, false);
                    dieSound.SetBaseGain(4.0f);
                }
                else
                if (rand >= 2 && rand < 3.0)
                {
                    dieSound = SoundManager3D.Instance.CreateSoundEntity(SoundManager3D.C_SOLDIER_DIE_3, soldierNode, false, false);
                    dieSound.SetBaseGain(3.0f);
                }
                else if (rand >= 3 && rand < 4.0)
                {
                    dieSound = SoundManager3D.Instance.CreateSoundEntity(SoundManager3D.C_SOLDIER_DIE_4, soldierNode, false, false);
                    dieSound.SetBaseGain(2.0f);
                }
                else
                {
                    dieSound = SoundManager3D.Instance.CreateSoundEntity(SoundManager3D.C_SOLDIER_DIE_5, soldierNode, false, false);
                    dieSound.SetBaseGain(2.0f);
                }
                dieSound.SetReferenceDistance(60); // make it a bit louder but dissapear faster

                //  prepareToFireSound = SoundManager3D.Instance.CreateSoundEntity(SoundManager3D.C_MISSILE_LOCK, soldierNode, true, false);
            }


            soldierNode.AttachObject(soldierModel);
            soldierNode.Scale(1.3f, 1.35f, 1.3f);
            runAnimationState           = soldierModel.GetAnimationState("run");
            die1AnimationState          = soldierModel.GetAnimationState("die1");
            die2AnimationState          = soldierModel.GetAnimationState("die2");
            prepareToFireAnimationState = soldierModel.GetAnimationState("prepareToFire");

            soldierNode.SetVisible(false);

            if (EngineConfig.DisplayingMinimap)
            {
                if (minimapItem == null)
                {
                    minimapItem =
                        new MinimapItem(soldierNode, framework.MinimapMgr, "Cube.mesh", new ColourValue(0.97f, 1.0f, 0.66f),
                                        soldierModel);
                    minimapItem.ScaleOverride = new Vector2(4, 7); // stala wysokosc bunkra, niezale¿na od bounding box
                }
                minimapItem.Refresh();
                minimapItem.Hide();
            }
        }