Exemple #1
0
    // Use this for initialization
    public void init(Boss owner)
    {
        this.name = "BossBeam";
        speed     = 6;
        m         = owner;

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

        model = modelObject.AddComponent <BossBeamModel>();                             // 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(2.2f, .2f, 1);

        this.transform.rotation = new Quaternion(m.transform.rotation.x, m.transform.rotation.y, m.transform.rotation.z, m.transform.rotation.w);
    }
Exemple #2
0
    // Use this for initialization
    public void init(Boss boss)
    {
        this.name = "BossBeam";
        m         = boss;
        speed     = m.chargeSpeed * 1.1f;
        health    = 2;


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

        model = modelObject.AddComponent <BossBeamModel>();                             // 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(1.8f, 0.2f, 1);
        this.GetComponent <BoxCollider2D> ().size = model.transform.localScale;
        this.transform.rotation = new Quaternion(m.transform.rotation.x, m.transform.rotation.y, m.transform.rotation.z, m.transform.rotation.w);
        this.m.m.bulletsFolder.Add(this.model.gameObject);
    }