示例#1
0
    protected override void ObjectSpawnEvent()
    {
        muzzleFlashParticle.transform.position    = shotPosition;
        muzzleFlashParticle.transform.eulerAngles = new Vector3(0, 0, shotAngle);
        muzzleFlashParticle.Play();
        soundCtrl.Shot();
        bulletParticle.Play();

        spawnSticky  = false;
        stickyObject = null;

        Ray        ray = new Ray(transform.position, transform.right);
        RaycastHit hitInfo;

        if (Physics.SphereCast(ray, bulletCollider.radius, out hitInfo, 100f, layersToCheck))
        {
            if (hitInfo.transform.gameObject.layer == LayerMask.NameToLayer("Obstacle"))
            {
                stickyObject = PoolManager.instance.GetPooledObject(stickyObjectType, gameObject).GetComponent <StickyObject>();
                spawnSticky  = stickyObject.Init(hitInfo.point, hitInfo.normal, Quaternion.LookRotation(Vector3.forward, hitInfo.normal));
            }
        }

        base.ObjectSpawnEvent();
    }
示例#2
0
    protected override void ObjectSpawnEvent()
    {
        soundCtrl.Shot();
        bulletParticle.Play();
        canMove = true;

        base.ObjectSpawnEvent();
    }
示例#3
0
 protected override void ObjectSpawnEvent()
 {
     bulletParticle.Play();
     soundCtrl.Shot();
     base.ObjectSpawnEvent();
 }