コード例 #1
0
    public bool Fire()
    {
        //Wait until missile is reloaded.
        if (Time.time - lastTimeFired < reloadTime)
        {
            return(false);
        }

        Instantiate(missilePrefab, transform.position, Quaternion.LookRotation(aimAtVector, Vector3.up));

        lastTimeFired = Time.time;

        musicHandler.SetLastTimeMissileFired();

        return(true);
    }