How to make projectile to shoot in a sine wave pattern

I’m making a 2d top down shooter like Galaga. I want the projectile to shoot from the ship and move up the screen with a sine wave pattern. This is all I got and I’m only able to move the projectile straight

public class Projectile : MonoBehaviour {

    // Used to control how fast the game object moves
    public float MoveSpeed = 5.0f;

	// Use this for initialization
	void Start () {
        DestroyObject(gameObject, 1.0f);

	}
	
	// Update is called once per frame
	void Update () {
        transform.position +=
            transform.up * Time.deltaTime * MoveSpeed;

	}
}

using UnityEngine;
using System.Collections;

public class Projectile : MonoBehaviour {
	
	public float MoveSpeed = 5.0f;

	public float frequency = 20.0f;  // Speed of sine movement
	public float magnitude = 0.5f;   // Size of sine movement
	private Vector3 axis;

	private Vector3 pos;

	void Start () {
		pos = transform.position;
		DestroyObject(gameObject, 1.0f);
		axis = transform.right;  // May or may not be the axis you want
		
	}
	
	void Update () {
		pos += transform.up * Time.deltaTime * MoveSpeed;
		transform.position = pos + axis * Mathf.Sin (Time.time * frequency) * magnitude;
	}
}