コード例 #1
0
ファイル: tBoss.cs プロジェクト: dearlux/PowerOfNumbers
        void FireSwirl(int angle)                                               //I made this take x and y because I was thinking about it and different enemies will need to fire from different parts of their models
        {
            GameObject  bulletObject = new GameObject();
            tBossBullet bullet       = bulletObject.AddComponent <tBossBullet>();

            bullet.init(this);
            bullet.transform.position    = new Vector3(this.transform.position.x, this.transform.position.y, 0);
            bullet.transform.eulerAngles = new Vector3(0, 0, angle);
        }
コード例 #2
0
ファイル: tBoss.cs プロジェクト: dearlux/PowerOfNumbers
        void FireBullet()                                               //I made this take x and y because I was thinking about it and different enemies will need to fire from different parts of their models
        {
            GameObject  bulletObject = new GameObject();
            tBossBullet bullet       = bulletObject.AddComponent <tBossBullet>();

            bullet.init(this);
            bullet.transform.position = new Vector3(this.transform.position.x, this.transform.position.y, 0);
            bullet.transform.rotation = new Quaternion(this.transform.rotation.x, this.transform.rotation.y, this.transform.rotation.z, this.transform.rotation.w);
        }
コード例 #3
0
ファイル: tBoss.cs プロジェクト: dearlux/PowerOfNumbers
 void FireBurst()
 {
     for (int x = 0; x <= 360; x = x + 10)
     {
         GameObject  bulletObject = new GameObject();
         tBossBullet bullet       = bulletObject.AddComponent <tBossBullet>();
         bullet.init(this);
         bullet.transform.position    = new Vector3(this.transform.position.x, this.transform.position.y, 0);
         bullet.transform.eulerAngles = new Vector3(this.transform.position.x, this.transform.position.y, x);
     }
 }
コード例 #4
0
        public void init(tBossBullet owner)
        {
            this.owner = owner;

            transform.parent        = owner.transform;                  // Set the model's parent to the gem.
            transform.localPosition = new Vector3(0, 0, 0);             // Center the model on the parent.
            name = "BossBullet Model";                                  // Name the object.

            mat             = GetComponent <Renderer>().material;
            mat.shader      = Shader.Find("Sprites/Default");                           // Tell the renderer that our textures have transparency. // Get the material component of this quad object.
            mat.mainTexture = Resources.Load <Texture2D>("Textures/bossBullet");        // Set the texture.  Must be in Resources folder.
            //mat.color = new Color(1,1,1);
        }