Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        this.name = "BossBullet";
        speed     = 6;

        var modelObject = GameObject.CreatePrimitive(PrimitiveType.Quad);               // Create a quad object for holding the gem texture.

        model = modelObject.AddComponent <BossBulletModel>();                           // Add a marbleModel script to control visuals of the gem.
        model.init(this);

        BoxCollider2D playerbody = gameObject.AddComponent <BoxCollider2D> ();

        playerbody.isTrigger = true;
        transform.localScale = new Vector3(.5f, .5f, 1);
    }
Esempio n. 2
0
    // Use this for initialization
    public void init(Boss boss)
    {
        owner     = boss;
        this.name = "BossBullet";
        speed     = owner.chargeSpeed * 1.5f;



        var modelObject = GameObject.CreatePrimitive(PrimitiveType.Quad);               // Create a quad object for holding the gem texture.

        model = modelObject.AddComponent <BossBulletModel>();                           // Add a marbleModel script to control visuals of the gem.
        model.init(this);

        BoxCollider2D playerbody = gameObject.AddComponent <BoxCollider2D> ();

        playerbody.isTrigger = true;
        transform.localScale = new Vector3(.35f, .35f, 1);
        this.owner.m.bulletsFolder.Add(this.model.gameObject);
    }