Beispiel #1
0
    void Spawn()
    {
        //Debug.Log("entering player attack state");
        Vector3 Owner_right = owner.mFacingRight ? new Vector3(1.0f, 0.0f, 0.0f) : new Vector3(-1.0f, 0.0f, 0.0f);
        Vector2 velocity    = new Vector2(Owner_right.x, Owner_right.y) * Mathf.SmoothStep(0.0f, owner.mBeamProjectileSpeed, owner.mBeamCounter / owner.mBeamMax);
        float   size        = 5.0f * (owner.mBeamCounter / owner.mBeamMax);
        float   offset      = owner.mAnikiState == PlayerController2D.ANIKI_STATES.FRONTAL ? 1.0f : 1.5f;

        size = size > 1.5f ? size : 1.5f;

        if (owner.mAnikiOne.mHp != 0)
        {
            AttackCollider = PlayerController2D.Instantiate(owner.WaterProjectilePrefab, new Vector3(0.0f, 0.0f, 0.0f), Quaternion.Euler(0.0f, 0.0f, 0)) as GameObject;
            AttackCollider.transform.position = mAnikiOne.transform.position + Owner_right * offset;
            AttackCollider.GetComponent <Rigidbody2D>().velocity = velocity;
            AttackCollider.GetComponent <Transform>().localScale = new Vector3(size, size, 5.0f);
        }

        if (owner.mAnikiTwo.mHp != 0)
        {
            AttackCollider = PlayerController2D.Instantiate(owner.WaterProjectilePrefab, new Vector3(0.0f, 0.0f, 0.0f), Quaternion.Euler(0.0f, 0.0f, 0)) as GameObject;
            AttackCollider.transform.position = mAnikiTwo.transform.position + Owner_right * offset;
            AttackCollider.GetComponent <Rigidbody2D>().velocity = velocity;
            AttackCollider.GetComponent <Transform>().localScale = new Vector3(size, size, 5.0f);
        }

        //owner.playShoot();
    }
Beispiel #2
0
    void Spawn()
    {
        //Debug.Log("entering player attack state");
        Vector3 Owner_right = owner.mFacingRight ? new Vector3(1.0f, 0.0f, 0.0f) : new Vector3(-1.0f, 0.0f, 0.0f);

        AttackCollider = PlayerController2D.Instantiate(owner.ProjectilePrefab, new Vector3(0.0f, 0.0f, 0.0f), Quaternion.Euler(0.0f, 0.0f, -90.0f)) as GameObject;

        AttackCollider.transform.position = owner.transform.position + Owner_right * offset;
        AttackCollider.GetComponent <Rigidbody2D>().velocity = new Vector2(Owner_right.x, Owner_right.y) * owner.mProjectileSpeed;

        //owner.playShoot();
    }