示例#1
0
 public MyController(MyTank tank)
 {
     this.tank = tank;
     this.TargetMarker = null;
     this.noise = new SoundClip("Noise");
     noise.AddTrack(new SoundEffectTrack("media/Sound-LoopNoise.wav"));
 }
示例#2
0
        private static Node Create(string nodeName, string tankName, Vector3 pos, Quaternion rot)
        {
            // タンク
            var cmp = new MyTank (tankName);

            // 車両(Body)
            var spr = new Sprite (40, 64);
            spr.SetOffset (-20, -34);
            spr.AddTexture (cmp.BodyTexture);
            spr.AddTexture (Resource.GetDefaultTexture ());

            // コリジョン他
            var col = new BoxCollision (20, 32, 0);

            var node = new Node (nodeName);
            node.Attach (cmp);
            node.Attach (spr);
            node.Attach (col);

            // 砲台(Turret)
            var tullet = MyTullet.Create ();
            tullet.GetComponent<Sprite> ().AddTexture (cmp.turretTexture);
            node.AddChild (tullet);

            node.DrawPriority = -2;
            node.Translation = pos;
            node.Rotation = rot;

            return node;
        }
示例#3
0
 public MyEnemyAI(MyTank tank)
 {
     this.tank = tank;
 }